Exemple #1
0
 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;
     }
 }
Exemple #2
0
 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;
     }
 }
Exemple #3
0
 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();
 }
Exemple #4
0
        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"));
            }
        }