-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pave the way for implementing prerequisite checks throughout the game
- Loading branch information
1 parent
bcc1413
commit b0b3b2f
Showing
14 changed files
with
870 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
lib/galaxies/prerequisites/building_prerequisite_building.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
defmodule Galaxies.Prerequisites.BuildingPrerequisiteBuilding do | ||
@moduledoc """ | ||
A Schema to represent the prerequisite buildings required to unlock a specific building. | ||
One example of this is that in order to build a Shipyard, you need a level 2 Robot Factory. | ||
This schema is used to represent building prerequisites on other buildings. | ||
""" | ||
alias Galaxies.Building | ||
|
||
use Ecto.Schema | ||
|
||
schema "building_prerequisites_buildings" do | ||
belongs_to :building, Building, type: :integer | ||
belongs_to :prerequisite_building, Building, type: :integer | ||
field :prerequisite_building_level, :integer | ||
end | ||
end |
17 changes: 17 additions & 0 deletions
17
lib/galaxies/prerequisites/building_prerequisite_research.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
defmodule Galaxies.Prerequisites.BuildingPrerequisiteResearch do | ||
@moduledoc """ | ||
A Schema to represent the prerequisite researches required to unlock a specific building. | ||
One example of this is that in order to build a Nanite Factory, you need a level 10 Computer Tech. | ||
This schema is used to represent research prerequisites for buildings. | ||
""" | ||
alias Galaxies.Building | ||
alias Galaxies.Research | ||
|
||
use Ecto.Schema | ||
|
||
schema "building_prerequisites_researches" do | ||
belongs_to :building, Building, type: :integer | ||
belongs_to :prerequisite_research, Research, type: :integer | ||
field :prerequisite_research_level, :integer | ||
end | ||
end |
17 changes: 17 additions & 0 deletions
17
lib/galaxies/prerequisites/research_prerequisite_building.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
defmodule Galaxies.Prerequisites.ResearchPrerequisiteBuilding do | ||
@moduledoc """ | ||
A Schema to represent the prerequisite buildings required to unlock a specific research. | ||
One example of this is that in order to build Weapons Tech, you need a level 4 Research Lab. | ||
This schema is used to represent building prerequisites for researches. | ||
""" | ||
alias Galaxies.Research | ||
alias Galaxies.Building | ||
|
||
use Ecto.Schema | ||
|
||
schema "research_prerequisites_buildings" do | ||
belongs_to :research, Research, type: :integer | ||
belongs_to :prerequisite_building, Building, type: :integer | ||
field :prerequisite_building_level, :integer | ||
end | ||
end |
17 changes: 17 additions & 0 deletions
17
lib/galaxies/prerequisites/research_prerequisite_research.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
defmodule Galaxies.Prerequisites.ResearchPrerequisiteResearch do | ||
@moduledoc """ | ||
A Schema to represent the prerequisite researches required to unlock a specific research. | ||
One example of this is that in order to research Astrophysics, | ||
you need a) level 4 Espionage Tech and b) level 3 Impulse Drive | ||
This schema is used to represent research prerequisites for other researches. | ||
""" | ||
alias Galaxies.Research | ||
|
||
use Ecto.Schema | ||
|
||
schema "research_prerequisites_researches" do | ||
belongs_to :research, Research, type: :integer | ||
belongs_to :prerequisite_research, Research, type: :integer | ||
field :prerequisite_research_level, :integer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
defmodule Galaxies.Prerequisites.UnitPrerequisiteBuilding do | ||
@moduledoc """ | ||
A Schema to represent the prerequisite buildings required to unlock a specific unit. | ||
One example of this is that in order to build Cruisers, you need a level 5 Shipyard. | ||
This schema is used to represent building prerequisites for units. | ||
""" | ||
alias Galaxies.Unit | ||
alias Galaxies.Building | ||
|
||
use Ecto.Schema | ||
|
||
schema "unit_prerequisites_buildings" do | ||
belongs_to :unit, Unit, type: :integer | ||
belongs_to :prerequisite_building, Building, type: :integer | ||
field :prerequisite_building_level, :integer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
defmodule Galaxies.Prerequisites.UnitPrerequisiteResearch do | ||
@moduledoc """ | ||
A Schema to represent the prerequisite researches required to unlock a specific building. | ||
One example of this is that in order to build a Nanite Factory, you need a level 10 Computer Tech. | ||
This schema is used to represent research prerequisites for buildings. | ||
""" | ||
alias Galaxies.Unit | ||
alias Galaxies.Research | ||
|
||
use Ecto.Schema | ||
|
||
schema "unit_prerequisites_researches" do | ||
belongs_to :unit, Unit, type: :integer | ||
belongs_to :prerequisite_research, Research, type: :integer | ||
field :prerequisite_research_level, :integer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.