public void MoveControl(Position startPosition, Position endPosition) { IWorldObjects worldObjects = GameWorld.GetWorldObjects(endPosition); if (worldObjects == null && GameWorld.GameGround[endPosition.Y, endPosition.X] != 'K') // spillerne kan ikke komme ud af banen og de kan rykke ind hvis feltet er tomt { Placement = endPosition; } else { if (worldObjects is ICharacter c) { c.RecieveDamage(Stategy.DamagePoints(this)); } } }
public override void Draw() { Console.Clear(); for (int i = 0; i < Height; i++) { for (int j = 0; j < Width; j++) { IWorldObjects o = GetWorldObjects(new Position(j, i)); if (o != null) { Console.Write(o.Show); } else { Console.Write(GameGround[i, j]); } } Console.Write("\n"); } }