This project demonstrates a turn-based game system implemented in Unity using C# scripting. It includes various components such as GameManager, PlayerController, AIController, and EndTurnButton to manage the game flow and player interactions.
The CompositionRoot
class serves as the entry point where dependencies are initialized and wired together. It initializes instances of GameManager, EndTurnButton, PlayerController, and AIController and ensures they are properly connected.
IPlayTurn
: Defines interfaces for player and AI controllers to begin and end their turns.ITurnManager
: Defines an interface for the GameManager to initialize turns and handle the end of each turn.
The GameState
enum defines various states of the game, including InitGame, PlayerTurn, AiTurn, and Results.
The GameManager class implements the game logic, including initializing turns, handling player and AI turns, and managing game states.
PlayerController
: Represents the player controller, implementing the IPlayTurn interface to handle player turn logic.AIController
: Represents the AI controller, implementing the IPlayTurn interface to handle AI turn logic.
To use this project, follow these steps:
- Attach the CompositionRoot script to a GameObject in your Unity scene.
- Assign references to GameManager, EndTurnButton, PlayerController, and AIController in the Inspector.
- Run the game and observe the turn-based gameplay mechanics.
This project has no external dependencies beyond Unity itself.
This project is licensed under the MIT License.