public override bool AcceptMove(Movable movable) { if (movable.GetType() == typeof(Movables.Baricade)) return false; return base.AcceptMove(movable); }
public virtual void Place(Movable movable) { if(movable.HasMovesLeft) { RemovePreviousMovable(movable); TempChild = movable; } else { if(!IsEmpty) { if (Child is Pawn) { //geslagen Child gaat naar juiste collectionfield' var sendToAfterHit = SendToAfterHit(Child as Pawn); sendToAfterHit.Children.Add(Child); Child.StandingOn = sendToAfterHit; } if(Child is Movables.Baricade) { Game.Current.SetBaricadeMoveMode(Child); } //baricademode moet worden aangezet als baricade wordt geslagen } RemovePreviousMovable(movable); Child = movable; } }
public static string Convert(Movable field) { var cf = field as Pawn; if (cf != null) return $"{cf.Number}"; return "B"; }
public override bool AcceptMove(Movable movable) { if (movable.GetType() == typeof(Movables.Baricade)) return false; if (movable.Owner != Player && !movable.IsHit) return false; if (Children.Count < 4) return base.AcceptMove(movable); return false; }
public override bool AcceptMove(Movable movable) { if(movable.IsLastMove && !IsEmpty) { return false; } if(movable is Movables.Baricade) { return false; } return base.AcceptMove(movable); }
public override bool AcceptMove(Movable movable) { if(movable is Pawn) { if(Child is Movables.Baricade) { if(movable.HasMovesLeft) { return false; } } else { if(!IsEmpty) { return movable.CanHit(Child.Owner); //var pawn = movable as Pawn; //var child = Child as Pawn; //if (pawn.Owner == child.Owner && movable.IsLastMove) //{ // return false; //} } } } if(movable is Movables.Baricade) { if (Child != null) { return false; } } return true; }
public override bool AcceptMove(Movable movable) { return false; }
public abstract bool AcceptMove(Movable movable);
internal void SetBaricadeMoveMode(Movable baricade) { MovingBaricade = baricade; SetBaricadeCursor(baricade.StandingOn); IsBaricadeMoveModeActive = true; }
public void ClearPrevious(Movable movable) { var cf = movable.StandingOn as ContainerField; if (cf != null) { if (cf.TempChild == movable) cf.TempChild = null; else cf.Child = null; } var collf = movable.StandingOn as CollectionField; if (collf != null) collf.Children.Remove(movable); }
void RemovePreviousMovable(Movable movable) { if (movable.IsFirstMove) { var standingOnContainer = movable.StandingOn as ContainerField; if (standingOnContainer == null) { var standingOnCollection = movable.StandingOn as CollectionField; standingOnCollection.Children.Remove(movable); } else //container { standingOnContainer.Child = null; } } else { var standingOnContainer = movable.StandingOn as ContainerField; if (standingOnContainer != null) { standingOnContainer.TempChild = null; } } }
public override void Place(Movable movable) { base.Place(movable); Game.Current.SetWin(); }