Пример #1
0
        public override bool MoveTo(MoveableObject moveableObject)
        {
            if (MoveableObject != null)
            {
                bool result;
                Tile tempTile;

                if (moveableObject.Tile == Down)
                {
                    tempTile = Up;
                }
                else if (moveableObject.Tile == Left)
                {
                    tempTile = Right;
                }
                else if (moveableObject.Tile == Up)
                {
                    tempTile = Down;
                }
                else if (moveableObject.Tile == Right)
                {
                    tempTile = Left;
                }
                else
                {
                    return(false);
                }

                if (!MoveableObject.CanMoveOtherObject && tempTile.MoveableObject != null && !tempTile.MoveableObject.CanMoveOtherObject)
                {
                    return(false);
                }
                else
                {
                    result = tempTile.MoveTo(MoveableObject);
                }

                if (!result)
                {
                    return(false);
                }
            }

            moveableObject.Tile.MoveableObject = null;

            MoveableObject = moveableObject;

            moveableObject.Tile = this;

            if (ActivationCounter >= 3 && !moveableObject.CanMoveOtherObject)
            {
                MoveableObject = null;
            }

            ActivationCounter += 1;

            return(true);
        }
Пример #2
0
 public override void Show()
 {
     if (MoveableObject != null)
     {
         MoveableObject.Show();
     }
     else
     {
         Console.Write(".");
     }
 }
Пример #3
0
 public override void Show()
 {
     if (this.MoveableObject != null)
     {
         MoveableObject.Show();
     }
     else
     {
         Console.ForegroundColor = ConsoleColor.Green;
         Console.Write("x");
         Console.ResetColor();
     }
 }
Пример #4
0
 public override void Show()
 {
     if (MoveableObject != null)
     {
         MoveableObject.Show();
     }
     else
     {
         if (ActivationCounter >= 3)
         {
             Console.Write(" ");
         }
         else
         {
             Console.Write("~");
         }
     }
 }
Пример #5
0
 public abstract bool MoveTo(MoveableObject moveableObject);
Пример #6
0
 public override bool MoveTo(MoveableObject moveableObject)
 {
     Console.WriteLine("deze g is een muur swa");
     return(false);
 }
Пример #7
0
 public override bool MoveTo(MoveableObject moveableObject)
 {
     return(false);
 }