I am learning C# now a days. I have to develop Tic Tac Toe game using SOLID principle. Although, I have developed some part of the game but I want to know if I am going in right direction. Below is the high level architecture of that game.
class Cell
class Board(Contains array of class Cell) : IPlayerMove
class Handler(Which takes user input, handle it and process it)
class Player(Player name, and its turn info)
In class Board, I have implemented IPlayerMoves interface which takes care of user moves and store user moves in tic tac board. This interface fired from Handler class. Now I have to find if the number player entered is already occupied or not. What I have to do? I am curently now in Handler class where player enters a number, how can I access from Handler class to Board clss without hurting the SOLID principle. Plus, please let me know the approach I am using is right or wrong. Thanks.
Aucun commentaire:
Enregistrer un commentaire