Ejemplo n.º 1
0
        /* mock constructor */
        protected Field(int width, int height)
        {
            currentField = this;
            cells = new FieldCellArray(width, height);

            timerManager = new TimerManager();
            players = new PlayerList(timerManager, CVars.cg_maxPlayers.intValue);

            m_tempCellsList = new LinkedList<FieldCell>();
            m_tempMovableList = new List<MovableCell>();

            movableCells = new LinkedList<MovableCell>();
        }
Ejemplo n.º 2
0
        public Field(Game game)
        {
            m_game = game;

            currentField = this;
            timerManager = new TimerManager();
            players = new PlayerList(timerManager, CVars.cg_maxPlayers.intValue);

            m_tempCellsList = new LinkedList<FieldCell>();
            m_tempMovableList = new List<MovableCell>();

            movableCells = new LinkedList<MovableCell>();

            m_playerAnimations = new PlayerAnimations();
            m_bombAnimations = new BombAnimations();
        }
Ejemplo n.º 3
0
        private void SetupPlayers(PlayerList players, PlayerLocationInfo[] locations)
        {
            List<Player> playerList = players.list;
            foreach (Player player in playerList)
            {
                int index = player.GetIndex();
                PlayerLocationInfo info = locations[index];
                int cx = info.x;
                int cy = info.y;

                if (cx == 0 && cy == 0)
                {
                    AddCell(player);
                }
                else
                {
                    player.SetCell(info.x, info.y);
                }

                ClearBrick(cx - 1, cy);
                ClearBrick(cx, cy - 1);
                ClearBrick(cx + 1, cy);
                ClearBrick(cx, cy + 1);
            }
        }