예제 #1
0
 public override bool Move(MoveAble moveAble)
 {
     moveAble.CurrentField.MoveAble = null;
     moveAble.CurrentField          = null;
     moveAble = null;
     return(true);
 }
예제 #2
0
        public override bool Move(MoveAble moveAble)
        {
            if (MoveAble != null)
            {
                return(true);
            }
            if (moveAble.MayNotMove)
            {
                return(true);
            }

            if (LowerField != null)
            {
                if (LowerField.Ship == null)
                {
                    moveAble.CurrentField.MoveAble = null;
                    MoveAble = moveAble;
                    moveAble.CurrentField = this;
                    moveAble.MayNotMove   = true;
                    LowerField.Ship       = moveAble;
                    return(true);
                }
            }
            moveAble.CurrentField.MoveAble = null;
            MoveAble = moveAble;
            moveAble.CurrentField = this;
            return(true);
        }
예제 #3
0
 public override string Print()
 {
     if (MoveAble != null)
     {
         return(MoveAble.Print());
     }
     return("▄");
 }
예제 #4
0
 public override bool Move(MoveAble moveAble)
 {
     if (MoveAble == null)
     {
         MoveAble = moveAble;
         moveAble.CurrentField.MoveAble = null;
         moveAble.CurrentField          = this;
     }
     return(true);
 }
예제 #5
0
 public virtual bool Move(MoveAble moveAble)
 {
     if (MoveAble != null)
     {
         return(false);
     }
     moveAble.CurrentField.MoveAble = null;
     moveAble.CurrentField          = this;
     this.MoveAble = moveAble;
     return(true);
 }
예제 #6
0
        public override bool Move(MoveAble moveAble)
        {
            if (MoveAble != null)
            {
                return(false);
            }

            if (!MayChangeNextField)
            {
                if (DirectionIsUp)
                {
                    if (moveAble.CurrentField == UpperField)
                    {
                        moveAble.CurrentField.MoveAble = null;
                        moveAble.CurrentField          = this;
                        this.MoveAble = moveAble;
                        return(true);
                    }
                    else
                    {
                        return(true);
                    }
                }
                else
                {
                    if (moveAble.CurrentField == LowerField)
                    {
                        moveAble.CurrentField.MoveAble = null;
                        moveAble.CurrentField          = this;
                        this.MoveAble = moveAble;
                        return(true);
                    }
                    else
                    {
                        return(true);
                    }
                }
            }
            else
            {
                moveAble.CurrentField.MoveAble = null;
                moveAble.CurrentField          = this;
                this.MoveAble = moveAble;
                return(true);
            }
        }
예제 #7
0
 public override bool Move(MoveAble moveAble)
 {
     MoveAble = moveAble;
     if (Ship != null)
     {
         Ship.AmountOfGold += moveAble.AmountOfGold;
         Game.Points++;
         if (Ship.AmountOfGold >= 8)
         {
             Ship.IsFull     = true;
             Ship.MayNotMove = false;
             Game.Points    += 10;
         }
         MoveAble.IsFull                = false;
         MoveAble.AmountOfGold          = 0;
         moveAble.CurrentField.MoveAble = null;
         moveAble.CurrentField          = this;
     }
     return(true);
 }
예제 #8
0
 public override string Print()
 {
     if (MoveAble != null)
     {
         return(MoveAble.Print());
     }
     if (MayChangeNextField)
     {
         if (DirectionIsUp)
         {
             return("/");
         }
         return("\\");
     }
     else
     {
         if (DirectionIsUp)
         {
             return("\\");
         }
         return("/");
     }
 }