/// <summary> /// Statiniu kliuciu zemelapyje gavimas /// </summary> /// <returns>kliutys zemelapyje</returns> public List <Obstacle> GetObstacles() { List <Obstacle> mapObstacles = new List <Obstacle>(); ObstacleCache.LoadCache(); Debris debris = (Debris)ObstacleCache.GetObstacle("debris"); debris.UpperLeftCoordinateX = 1; debris.UpperLeftCoordinateY = 1; mapObstacles.Add(debris); Rock rock = (Rock)ObstacleCache.GetObstacle("rock"); rock.UpperLeftCoordinateX = 2; rock.UpperLeftCoordinateY = 2; mapObstacles.Add(rock); Debris debris2 = (Debris)ObstacleCache.GetObstacle("debris"); debris2.UpperLeftCoordinateX = 3; debris2.UpperLeftCoordinateY = 3; mapObstacles.Add(debris2); Rock rock2 = (Rock)ObstacleCache.GetObstacle("rock"); rock2.UpperLeftCoordinateX = 4; rock2.UpperLeftCoordinateY = 4; mapObstacles.Add(rock2); return(mapObstacles); }
public static void LoadCache() { Debris debris = new Debris(); _obstacleMap.Add("debris", debris); Rock rock = new Rock(); _obstacleMap.Add("rock", rock); }