Exemplo n.º 1
0
 protected virtual void CreateMeeples()
 {
     for (int i = 0; i < 2; i++)
     {
         GhostMeeple newMeep = new GhostMeeple(this, new Rectangle(0, 0, Board.Instance().boardUnit, Board.Instance().boardUnit), UID + "_meeple" + i, meepIdx: i);
         newMeep.Create();
     }
 }
Exemplo n.º 2
0
 public static void OnGameOver(GhostMeeple winner)
 {
     if (PlayerManager.Instance().GetLocalMeeples().TrueForAll(m => m.hasWon))
     {
         GameOverCommand go = new GameOverCommand(winner.ghostPlayer);
         PlayerManager.Instance().local.HandleInput(go, true);
     }
 }
Exemplo n.º 3
0
    public static MoveGMCommand FromInput(SerializableCommand sCommand)
    {
        try
        {
            GhostMeeple movingEl             = (GhostMeeple)Board.Instance().FindByUID(sCommand.UID);
            PyramidFloorBoardElement floorEl = (PyramidFloorBoardElement)Board.Instance().FindByUID(sCommand.body);

            return(new MoveGMCommand(movingEl, floorEl));
        }
        catch (InvalidCastException ice)
        {
            Console.WriteLine(ice.Message);
            return(null);
        }
    }
Exemplo n.º 4
0
    public bool AddMeepleRef(GhostMeeple m)
    {
        if (!playerMeeples.ContainsKey(m.ghostPlayer))
        {
            playerMeeples.Add(m.ghostPlayer, new List <GhostMeeple>());
        }

        // guaranteed to return non null
        List <GhostMeeple> selected = playerMeeples[m.ghostPlayer];

        if (selected.Count < Game1.meepleCount)
        {
            selected.Add(m);
            return(true);
        }
        return(false);
    }
Exemplo n.º 5
0
 public MoveGMCommand(GhostMeeple element, PyramidFloorBoardElement moveTo)
 {
     this.element = element;
     this.moveTo  = moveTo;
 }
Exemplo n.º 6
0
 public AddGhostMeepleToPlayerManager(GhostMeeple meeple)
 {
     this.meeple = meeple;
 }