Пример #1
0
 private void InitialMap(int size)
 {
     for (int i = 0; i < size; i++)
     {
         RowDefinition    RD = new RowDefinition();
         ColumnDefinition CD = new ColumnDefinition();
         Map.RowDefinitions.Add(RD);
         Map.ColumnDefinitions.Add(CD);
     }
     CurrentWorld = Game.InitialWorld;
     Game.MoveDirection moveDirection = Game.MoveDirection.Left;
 }
Пример #2
0
        private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
            case Key.Up:
                moveDirection = Game.MoveDirection.Up;
                break;

            case Key.Down:
                moveDirection = Game.MoveDirection.Down;
                break;

            case Key.Left:
                moveDirection = Game.MoveDirection.Left;
                break;

            case Key.Right:
                moveDirection = Game.MoveDirection.Right;
                break;
            }
            CurrentWorld = Game.newWorld(moveDirection, CurrentWorld);
        }
Пример #3
0
 public static bool CanPlay(Card c, Game.World w)
 {
     return(w.Stack >= c.CostStacks && w.Ore >= c.CostOre && w.Mana >= c.CostMana);
 }