/// <summary> /// Creates a node that doesn't make it's connections in the constructor. /// </summary> /// <param name="x">The X</param> /// <param name="y">The Y</param> /// <param name="forceNodeCreation">Instantly creates connections.</param> public Node(RTSCollisionMap map, int x, int y, Boolean forceNodeCreation) : base(map) { Init(x, y); if (forceNodeCreation) this.CreateConnections(PathfindingNode.MAX_CONNECT_RANGE); else SmartPathfindingNodeProcessor.GetInstance().Push(this); }
public BuildingMesh(RTSCollisionMap collision) { this.collision = collision; createdNodes = new Node[4]; removedNodes = new CustomArrayList<Point>(); }
public Node(RTSCollisionMap map, int x, int y) : base(map) { Init(x, y); PathfindingNodeProcessor.GetInstance().Push(this); }
/// <summary> /// Creates a node that doesn't make it's connections in the constructor. /// </summary> /// <param name="x">The X</param> /// <param name="y">The Y</param> /// <param name="forceNodeCreation">Instantly creates connections. This param does nothing.</param> public Node(RTSCollisionMap map, int x, int y, Boolean forceNodeCreation) : base(map) { Init(x, y); this.CreateConnections(); }
/// <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 drawLineTexture = this.Content.Load<Texture2D>("Misc/solid"); font = Content.Load<SpriteFont>("Fonts/Arial"); (collision = new RTSCollisionMap(this, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight)).PlaceNodesAroundEdges(); graphics.PreferMultiSampling = true; (quadTree = new QuadRoot(new Rectangle(0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight) )).CreateTree(5); players = new LinkedList<Player>(); Alliance redAlliance = new Alliance(); Player humanPlayer = new Player(redAlliance, Color.Red); players.AddLast((CURRENT_PLAYER = humanPlayer)); humanPlayer.SpawnStartUnits(new Point((int)Game1.GetInstance().graphics.PreferredBackBufferWidth / 2, (int)Game1.GetInstance().graphics.PreferredBackBufferWidth / 2)); Alliance greenAlliance = new Alliance(); Player aiPlayer = new Player(greenAlliance, Color.Green); players.AddLast(aiPlayer); aiPlayer.SpawnStartUnits(new Point((int)Game1.GetInstance().graphics.PreferredBackBufferWidth / 2, 200)); //SaveManager.GetInstance().SaveNodes("C:\\Users\\Wouter\\Desktop\\test.xml"); MouseManager.GetInstance().mouseClickedListeners += ((MouseClickListener)this).OnMouseClick; MouseManager.GetInstance().mouseReleasedListeners += ((MouseClickListener)this).OnMouseRelease; MouseManager.GetInstance().mouseMotionListeners += ((MouseMotionListener)this).OnMouseMotion; MouseManager.GetInstance().mouseDragListeners += ((MouseMotionListener)this).OnMouseDrag; /*XNAPanel panel = new XNAPanel(null, new Rectangle( this.graphics.PreferredBackBufferWidth / 2 - 200, this.graphics.PreferredBackBufferHeight / 2 - 200, 400, 400)); XNAButton button = new XNAButton(panel, new Rectangle(10, 10, 100, 40), "");*/ base.Initialize(); }