コード例 #1
0
        public CavernaPlayerTilesManager(CavernaPlayer player)
        {
            _player = player;
            _doubleFencedPastures = new List<Vector2>();
            TilesToPlace = new List<string>();

            CaveSpaces[0, 0] = TileTypes.StartingTile;
            CaveSpaces[0, 1] = TileTypes.Cavern;
        }
コード例 #2
0
        private void SetPlayerPlaceTiles(CavernaPlayer player, List<string> tileList)
        {
            bool isCave = tileList[0] == TileTypes.Cavern ||
                tileList[0] == TileTypes.DeepTunnel ||
                tileList[0] == TileTypes.OreMine ||
                tileList[0] == TileTypes.RubyMine ||
                tileList[0] == TileTypes.Tunnel;

            List<Vector2> validSpots = player.SetTilesToPlace(tileList);
            _serverSocket.SetPlaceTile(player.ID, tileList[0], validSpots, isCave);
        }
コード例 #3
0
 private void SetPlayerPlaceTile(CavernaPlayer player, string tile)
 {
     SetPlayerPlaceTiles(player, new List<string> {tile});
 }
コード例 #4
0
 private void ReturnControlToPlayer(CavernaPlayer player)
 {
     if (player.RearrangeAnimalsCheck())
         return;
     else if (_isHarvest)
         RunHarvest();
     else if (_activeActionSpaceID > 0)
         GetActions("playerID", _activeActionSpaceID);
     else
     {
         foreach (CavernaActionSpace space in _actionSpaces)
         {
             if (!space.IsUsed)
                 _serverSocket.SetActionSpaceActive(space.ID);
         }
     }
 }
コード例 #5
0
 public void CollectResources(CavernaPlayer player, int actionSpaceID)
 {
     CavernaActionSpace actionSpace = _actionSpaces.Find(x => x.ID == actionSpaceID);
     actionSpace.CollectResources(_players[0], _serverSocket);
 }