public MapObject(ManagerMouse managerMouse, Sprite sprite, ManagerTiles managerTiles, ManagerUnits managerUnits) { Id = ++_idCounter; _sprite = sprite; _movement = new Movement(Id, _sprite, managerTiles, managerUnits); managerMouse.MouseEventHandler += managerMouse_MouseEventHandler; managerMouse.MouseClickEventHandler += managerMouse_MouseClickEventHandler; }
public Pathfinding(int id, Sprite sprite, ManagerTiles managerTiles, ManagerUnits managerUnits) { _id = id; _sprite = sprite; _managerTiles = managerTiles; _path = new List<Vector2>(); _managerUnits = managerUnits; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here _camera = new Camera(); _camera.ViewportWidth = graphics.GraphicsDevice.Viewport.Width; _camera.ViewportHeight = graphics.GraphicsDevice.Viewport.Height; _camera.MoveCamera(_camera.ViewportCenter); _managerMouse = new ManagerMouse(_camera); _managerTiles = new ManagerTiles(2000, 2000); _managerUnits = new ManagerUnits(_managerMouse, _managerTiles); base.Initialize(); }
public ManagerUnits(ManagerMouse managerMouse, ManagerTiles managerTiles) { _teams = new List <TeamUnits>(); //For test var mapObjects = new List <MapObject>(); for (int n = 0; n < 4; n++) { mapObjects.Add(new MapObject(managerMouse, new Sprite(3, 4 + n), managerTiles, this)); } _teams.Add(new TeamUnits(mapObjects, "player", new List <string>())); }
public ManagerUnits(ManagerMouse managerMouse, ManagerTiles managerTiles) { _teams = new List<TeamUnits>(); //For test var mapObjects = new List<MapObject>(); for (int n = 0; n < 10; n++) { mapObjects.Add(new MapObject(managerMouse, new Sprite(2, 1 + n), managerTiles, this)); } for (int n = 0; n < 10; n++) { mapObjects.Add(new MapObject(managerMouse, new Sprite(3, 1+ n), managerTiles, this)); } for (int n = 0; n < 10; n++) { mapObjects.Add(new MapObject(managerMouse, new Sprite(4, 1 + n), managerTiles, this)); } _teams.Add(new TeamUnits(mapObjects, "player", new List<string>())); }
public Movement(int id, Sprite sprite, ManagerTiles managerTiles, ManagerUnits managerUnit) { _sprite = sprite; _speed = 4; _pathfinding = new Pathfinding(id, sprite, managerTiles, managerUnit); }