Ejemplo n.º 1
0
    //NOTE: Should be called after switching the active player!
    public void HandleBeginningOfTurn(PlayerManager activePlayer)
    {
        //call HandleBeginningOfTurn() on all HenchmanCards in play, in the order they came into play
        RemoveQueue <BoardSpaceEnum> newOrder = new RemoveQueue <BoardSpaceEnum>();

        while (!henchmenOrder.IsEmpty())
        {
            BoardSpaceEnum henchmanSpace = henchmenOrder.Dequeue();
            HenchmanCard   henchman      = board[henchmanSpace];
            if (henchman.GetController() == activePlayer)
            {
                henchman.HandleBeginningOfTurn();
            }
            newOrder.Enqueue(henchmanSpace);
        }
        henchmenOrder = newOrder;
    }
Ejemplo n.º 2
0
        public void Do()
        {
            OctreeAdd    tmp;
            OctreeRemove remove;

            while (true)
            {
                System.Console.WriteLine("working it.");
                while (AddQueue.Count > 0)
                {
                    tmp = AddQueue.Dequeue();
                    if (tmp == null)
                    {
                        continue;
                    }
                    if (tmp.x >= Size.X || tmp.y >= Size.Y || tmp.z >= Size.Z || tmp.x < 0 || tmp.y < 0 || tmp.z < 0)
                    {
                        continue;
                    }
                    if (root == null)
                    {
                        this.root = new OctreeNode((int)Math.Max(Size.X, Math.Max(Size.Y, Size.Z)), 0, 0, 0, ref tmp.color);
                    }

                    root.Add(tmp.x, tmp.y, tmp.z, tmp.size, ref tmp.color);
                }


                while (RemoveQueue.Count > 0)
                {
                    remove = RemoveQueue.Dequeue();
                    if (root == null)
                    {
                        continue;
                    }
                    root.Remove(remove.x, remove.y, remove.z);
                    UpdateNeighbors(remove.x, remove.y, remove.z);
                }

                faceBatch.Update();
            }
        }
Ejemplo n.º 3
0
            public void Process()
            {
                if (ToBeCleared)
                {
                    Clear();
                    AddQueue.Clear();
                    RemoveQueue.Clear();
                    return;
                }

                while (AddQueue.Count > 0)
                {
                    ProcessAdd(AddQueue.Dequeue());
                }
                while (RemoveQueue.Count > 0)
                {
                    base.Remove(RemoveQueue.Dequeue());
                }

                return;
            }