public Water(int x, int y, int width, int height, List <Player> players) : base(x, y, width, height) { Players = players; Image = ResourcesPath.BitmapFromPath(ResourcesPath.WaterPath); foreach (Player player in players) { player.FinishedMove += CheckIfCollisionWithPlayer; } }
public Pod(int x, int y, int width, int height, List <Player> players) : base(x, y, width, height) { CreatedPods++; Image = ResourcesPath.BitmapFromPath(ResourcesPath.PodEmptyPath); Players = players; foreach (Player player in Players) { player.FinishedMove += CheckIfCollisionWithPlayer; player.TryingToMove += CheckIfPlayerCanGetIn; } }
public Wood(int x, int y, int width, int height, int xmovement, int ymovement, MapInfo mapInfo, List <Player> players) : base(x, y, width, height) { Image = ResourcesPath.BitmapFromPath(ResourcesPath.WoodPath); Players = players; foreach (Player player in Players) { player.Moved += CheckIfCollisionWithPlayer; } Xmovement = xmovement; Ymovement = ymovement; this.mapInfo = mapInfo; timer.Tick += MoveOnTick; timer.Interval = TimeSpan.FromSeconds(0.02); timer.Start(); }
public Backgroud(int x, int y, int width, int height, Type type) : base(x, y, width, height) { switch (type) { case Type.GRASS: Image = ResourcesPath.BitmapFromPath(ResourcesPath.GrassPath); break; case Type.ROAD: Image = ResourcesPath.BitmapFromPath(ResourcesPath.RoadPath); break; default: throw (new ArgumentOutOfRangeException($"Type {type} not recognized")); } }