예제 #1
0
파일: Board.cs 프로젝트: ds0nt/group-15-3
        public Board(Player[] players)
        {
            me = this;
            game = LotusGame.get();

            selectedId = int.MinValue;

            this.players = players;

            startTiles = new List<Player>[12];
            gameTiles = new List<Player>[18];
            for (int i = 0; i < startTiles.Length; i++)
                startTiles[i] = new List<Player>();
            for (int i = 0; i < gameTiles.Length; i++)
                gameTiles[i] = new List<Player>();

            startPoints = new PointF[12];
            gamePoints = new PointF[18];

            CreateBoard();
            CreateStartLocationsTable();
            CreateLocationsTable();
            resetPlayers();
        }
예제 #2
0
파일: Board.cs 프로젝트: ds0nt/group-15-3
 public Board(LotusGame lotusGame, Player[] players)
 {
     // TODO: Complete member initialization
     this.lotusGame = lotusGame;
     this.players = players;
 }
예제 #3
0
        private bool isSelectValid(int select, Player p)
        {
            List<Player> starttile = Board.get().getTile(select);

            if (select == 29)
                return false;
            if (starttile.Count > 0 && starttile[starttile.Count - 1] == p || !canMove(p))
            {
                return true;
            }
            return false;
        }
예제 #4
0
 private bool isMoveValid(int start, int end, Player p)
 {
     List<Player> starttile = Board.get().getTile(start);
     start -= Board.get().startTiles.Length;
     end -= Board.get().startTiles.Length;
     if (starttile[starttile.Count - 1] == p || !canMove(p))
     {
         int dist = starttile.Count;
         if (start < 0)
         {
             if (dist < 4)
                 if (dist - 1 == end)
                     return true;
             if (dist + 2 == end)
                 return true;
         }
         else
         {
             if (start < 3 && start + dist > 2)
                 dist += 3;
             if (end == Math.Min(start + dist, Board.get().gameTiles.Length - 1))
                 return true;
         }
     }
     return false;
 }
예제 #5
0
 private bool canMove(Player p)
 {
     for (int i = 0; i < Board.get().startTiles.Length + Board.get().gameTiles.Length - 1; i++)
     {
         List<Player> tile = Board.get().getTile(i);
         if (tile.Count != 0 && tile[tile.Count - 1] == p)
             return true;
     }
     return false;
 }
예제 #6
0
        public void LaunchGame(Player[] players)
        {
            this.players = players;
            board = Board.get();
            scheduledEvents = new List<ScheduledEvent>();

            Graphics.GraphicsFacade.mode = Graphics.GraphicsFacade.Mode.BOARD;
        }