Fields - Avihay-Games-Ltd/Super-Tactico GitHub Wiki
public enum Type- Sea,Land,Both.
Every tool and tile in the game will get his type.
The Type of a tool will decide on what kinds of tiles this tool can step,
and the type of a tile will be for checking if a tool can step on it.
public enum Direction-Left,Right,Up,Down.
This enum represents the possible movement directions.
If one of the players want to move a tool, after he click on the wanted tile the direction will pass to the
ToolMovement of the tool and it will execute the movement.
int TurnPlayerID-
Stores the ID of the player whose turn is the current turn.
With this variable every turn the GameMnager knows which player can move his tool.
bool GameOver-
A boolean that intiliazed to be false, and after every turn checked to become true if one of the players won(or it's a tie);
When this variable's value become true, the game is over
(with message on the screen that declares about a winner) and returns to the main menu.
Tile ClickedTile-
A reference to the tile that the current turn player clicked on to move the tool that steps on.
It used when the player regrets and click on another tile, so all the previous clicked tile return to normal.
(by using this reference to get to the tile)
GameObject Board-
A reference to the game's board.
By the board, the GameManager knows the structure of the board and to which tiles can be reached from a specific tile.
public List Player1Tools && public List Player2Tools
lists of the game tools of each player.
With this list, the GameManager knows how many tools left for the player.
For example, if one of the lists is empty, the game is over and the other player wins.
Dictionary<Tile, Dictionary<Direction , Tile>> board-
The board of the game is logically organized in the Dictionary data structure.
A Dictionary has keys and value - each unique key has a value.
In this the Dictionary, the keys are the tiles in the board and the value is also
a Dictionary with Directions as keys and Tiles as value.
Each tile you gives as a key to the board gives you a Dictionary that shows which tile is found in
all the every direction from the tile.
int rownum-
The row num of the tile.can be between 1-20.
This variable helps to locate the tile if needed.
int tilenum-
The tile num in the row. can be between 1-20.
This variable helps to locate the tile if needed.
string fieldType-
Stores a string that represent the name of the field in the game.
For example : "Neutral sea","Player1 island","Player2 land " etc.
This field is needed because it helps to check if one of the players' flag is on the other's island.
Another way that it helps to know where to initialize the set of tools of each player.
[SerializeField]GameTool.Type type-
This field represents the type of the tile: Sea or Land.
By this type, we know which tool can step on this tile, and when to make it available to move to.
This field is SerializeField, such that game designers can change the tiles as they think.
GameTool currentStepingGameTool-
Reference to the current GameTool that steps on the tile.
The uses of this refernce are very important:
- To know every tool's location in the game.
- If the player move with one of it's tools to another tile - to know if there is an opponent's tool there and there is a battle or not.
GameManager game-
Refernce to the GameManager.
This refernce goal, is to update the clickedTile if the current tile has been clicked,
and to activate some GameManager's relevent functions that depends on tile's click.
Material regMaterial-
The regular material of the tile:
Sea Material for Sea tiles and Land Material for Land tiles.
Material transparent1-
When the tiles becomes available to move to,
the tile will gain a transparent coating to notice the player which tiles the tool he chose can walk to.
Material transparent2-
If the players stand with the mouse on an available tile,
it will get another transparent coating to notice the player that if he mouseclick there,
the tool wil move to thi tile.
bool canBeClicked-
A boolean variable that becomes true if it has tool of the player whose turn is the current turn.
bool canWalkTo-
A boolean variable that becomes true if a clicked tool can walk to this tile.
bool gameToolResized-
When the player mouse over on is turn above tile with one of his tools, the tool's size grows by 0.1 scale,
to notice the player which tool he picks if he mouse click there
This boolean variable makes sure that the tool wont resize more then 0.1 scale.
int PlayerID-
stores the ID(1 or 2) of the player that this tool belongs to.
This is a very important field because according to it the movement ability of the tool be activate or deactivate.
[SerializeField] int rank-
stores the rank (strength) of the tool.
The rank will be the factor that decides which tool is the winner during battle:
If one tool has a higher rank then the other it wins in battle and the other tool will be destroyed.
If two tools have the same rank both of them will be destroyed in battle.
The ranks are numbers in the range 1-8( 1 is the weakest and 8 the strongest).
The field is serialized, with the purpose to give game designers the opportunity to change the strength of the tools as they want.
[SerializeField] Type type-
stores the Type(enum from The GameManager) of the tool.
The Type of tool can be Land, Sea, or Both.
It decides on which tiles the tool can move and which tool he can attack or be attacked by.
The field is serialized, with the purpose to give game designers the opportunity to change the type of the tools as they want.
bool ranked-
Stores true if a tool already got his rank.
It's important because .
Animator anim-
The Animator of the tool.
When a tool is standing, moving, attacking, been destroying, the animator turns on the right animation.
In this specific reference of the Animator, the purpose is to turn on the moving animation when the tool is moving.
Direction prevoius-
Stores the previous moving direction.
It's needed for knowing to which direction to rotate the tool before moving.
Direction current-
Stores the current moving direction.
It's needed for knowing to which direction to rotate the tool before moving.
readonly static float tileSize-
Stores the size of the tiles in the game (5f X 5f).
It's needed to know how far the tool needs to go while moving between tiles.
Vector3 PosToWalk-
Stores the position of the tile that the tool moves to.
while the tool is not moving, PosToWalk equals to the current position of the tool.
[SerializeField] int tilesToPass-
[SerializeField]int loadCapability-
This variable represent the number of tools that the tool can load.
This variable gets initialize in the start of the game when the tools is created.
This is a SerializeField because maybie game designers will want to change the load capabilities of the tools
if they think it's better
[SerializeField] bool canBeLoaded-
A boolean variable that stores if the tool i loadable or not.
This field is a SerializeField 'because maybie game designers will think the some tools need to be unloadable,
or maybie they will want to cancel all the loading ability and they will set all the tiles load ability to false.
bool setCapability-
A boolean variable the makes sure that after the initialize of the loading capability of a tool it's unchangeable.
List loadedGameTools-
List of all the tools are loaded on this tool.
This list's size cannot be greater then the loadCapability of the tool.