Example #1
0
        public ITile GetTile(Coordinate coordinate, OwnerTypeEnum ownerType)
        {
            switch (ownerType)
            {
            case OwnerTypeEnum.Player:
                return(PlayerTileMatrix.GetTile(coordinate));

            case OwnerTypeEnum.Enemy:
                return(EnemyTileMatrix.GetTile(coordinate));

            default:
                throw new ArgumentOutOfRangeException(nameof(ownerType), ownerType, null);
            }
        }
Example #2
0
        public void TileClicked(Coordinate coordinate, OwnerTypeEnum ownerType)
        {
            ITile tile = null;

            switch (ownerType)
            {
            case OwnerTypeEnum.Player:
                tile = PlayerTileMatrix.GetTile(coordinate);
                break;

            case OwnerTypeEnum.Enemy:
                tile = EnemyTileMatrix.GetTile(coordinate);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(ownerType), ownerType, null);
            }
            tile.Click();
        }
Example #3
0
 public void Clear()
 {
     PlayerTileMatrix.Clear();
     EnemyTileMatrix.Clear();
     _playerShips.Clear();
 }