Ejemplo n.º 1
0
 public CommandGoForward(int tractorId, Map map)
 {
     this.map     = map;
     this.tractor = map.Tractors.Where(a => a.Id == tractorId).First();
     x            = tractor.X;
     y            = tractor.Y;
 }
Ejemplo n.º 2
0
        public void InitObjects()
        {
            for (int j = 0; j < CurrentMap.Targets.Count; j++)
            {
                GameObject target = CurrentMap.Targets[j];
                View.Children.Add(target.ImageControl);
                Canvas.SetLeft(target.ImageControl, target.X * CurrentMap.TileWidth);
                Canvas.SetTop(target.ImageControl, target.Y * CurrentMap.TileHeight);
            }
            for (int j = 0; j < CurrentMap.Tractors.Count; j++)
            {
                Tractor tractor = CurrentMap.Tractors[j];

                int x = tractor.X * CurrentMap.TileWidth;
                int y = tractor.Y * CurrentMap.TileHeight;

                View.Children.Add(tractor.Backlight);
                View.Children.Add(tractor.ImageControl);
                View.Children.Add(tractor.Label);
                tractor.Init(CurrentMap.TileWidth, CurrentMap.TileHeight, CurrentMap.MapWidth, CurrentMap.MapHeight);
            }
        }
Ejemplo n.º 3
0
 public CommandRoundToLeft(int tractorId, Map map)
 {
     this.map     = map;
     this.tractor = map.Tractors.Where(a => a.Id == tractorId).First();
 }