public override bool Move(MoveAble moveAble) { moveAble.CurrentField.MoveAble = null; moveAble.CurrentField = null; moveAble = null; return(true); }
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); }
public override string Print() { if (MoveAble != null) { return(MoveAble.Print()); } return("▄"); }
public override bool Move(MoveAble moveAble) { if (MoveAble == null) { MoveAble = moveAble; moveAble.CurrentField.MoveAble = null; moveAble.CurrentField = this; } return(true); }
public virtual bool Move(MoveAble moveAble) { if (MoveAble != null) { return(false); } moveAble.CurrentField.MoveAble = null; moveAble.CurrentField = this; this.MoveAble = moveAble; return(true); }
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); } }
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); }
public override string Print() { if (MoveAble != null) { return(MoveAble.Print()); } if (MayChangeNextField) { if (DirectionIsUp) { return("/"); } return("\\"); } else { if (DirectionIsUp) { return("\\"); } return("/"); } }