コード例 #1
0
 public OceloController()
 {
     _ban         = new Ban(8);
     _processData = new GameControllData(GameControllData.PlayerColor.BLACK);
     //_gamestate = GameState.Display;
     InitAction();
 }
コード例 #2
0
    void PrepareGame()
    {
        if (inited)
        {
            return;
        }
        inited   = true;
        _myColor = (_myoceloCtrl._processData._PlayerData[0]._PlNumber == _myPlNum) ? _myoceloCtrl._processData._PlayerData[0]._PlColor : _myoceloCtrl._processData._PlayerData[1]._PlColor;
        //プレイヤーの設定
        _myPl._MyColor = _myColor;
        if (_gameSetting._pltype_1p != PlayerSetter.PlType.None)
        {
            _myPl._myPlType = _gameSetting._pltype_1p;
        }
        _enemyPl._MyColor = GameControllData.GetOtherColor(_myColor);
        if (_gameSetting._pltype_2p != PlayerSetter.PlType.None)
        {
            _enemyPl._myPlType = _gameSetting._pltype_2p;
        }
        _myoceloCtrl._oceloPlayer.Add(_myPl.CreatePlayer());
        _myoceloCtrl._oceloPlayer.Add(_enemyPl.CreatePlayer());

        var plTypeText = (_myColor == GameControllData.PlayerColor.BLACK) ? "黒" : "白";

        _userTypeDisplay.text = $"あなたは{plTypeText}です";

        SetTurnGuid();
    }
コード例 #3
0
        public void Test_jsonSave(GameControllData.PlayerColor plcolor)
        {
            gameProcessData = new GameControllData(plcolor);
            var json = JsonConverter.ToJson(gameProcessData);
            var data = JsonConverter.FromJson <GameControllData>(json);

            Assert.AreEqual(gameProcessData._ActivePlayerColor, data._ActivePlayerColor);
        }
コード例 #4
0
 public void SyncKoma(int[,] banData)
 {
     for (int x = 0; x < 8; x++)
     {
         for (int y = 0; y < 8; y++)
         {
             _masus[x][y].SetSprite(GameControllData.ConvertNum2Color(banData[x, y]));
         }
     }
 }
コード例 #5
0
 public void Test_SwichPl(GameControllData.PlayerColor plcolor)
 {
     gameProcessData = new GameControllData(plcolor);
     gameProcessData.SwichActivePlayer();
     Assert.AreNotEqual(plcolor, gameProcessData._ActivePlayerColor);
 }
コード例 #6
0
 public void SetUp()
 {
     gameProcessData = new GameControllData(GameControllData.PlayerColor.BLACK);
 }
コード例 #7
0
 static int GetReverseNum(int num)
 {
     return(GameControllData.GetOtherColor(num));
 }