Пример #1
0
 // Start is called before the first frame update
 void Start()
 {
     gameMaster = GameObject.Find("Board").GetComponent <GameControl>();
     pcType     = gameObject.name.Substring(0, 4);
     pcc        = PieceContainerFactory.GetPieceContainer(pcType, gameObject.name, gameMaster, pieces);
     pcc.Start();
     pcc.CalcPossibleMoves();
 }
Пример #2
0
 public GameState(GameControl initGameMaster)
 {
     foreach (PieceContainerObject pObj in initGameMaster.allSpots)
     {
         allSpots[pObj.pcc.position] = PieceContainerFactory.GetPieceContainer(pObj);
     }
     blackJail = PieceContainerFactory.GetPieceContainer(initGameMaster.blackJailControl);
     whiteJail = PieceContainerFactory.GetPieceContainer(initGameMaster.whiteJailControl);
     blackBase = PieceContainerFactory.GetPieceContainer(initGameMaster.blackBaseControl);
     whiteBase = PieceContainerFactory.GetPieceContainer(initGameMaster.whiteBaseControl);
     foreach (PieceContainerControl pcc in allSpots)
     {
         pcc.InitializeOtherPieceContainerControls(allSpots, whiteJail, blackJail, whiteBase, blackBase);
     }
     blackJail.InitializeOtherPieceContainerControls(allSpots);
     whiteJail.InitializeOtherPieceContainerControls(allSpots);
     blackBase.InitializeOtherPieceContainerControls(allSpots);
     whiteBase.InitializeOtherPieceContainerControls(allSpots);
 }