// -------------------------------------------------------------------------- // CONSTRUCTOR // -------------------------------------------------------------------------- public Cursor(CircuitRenderer cRend, Texture2D pixel) { cCase = new NXTCase(Case.STRAIGHT); this.tStraight = cRend.Texture_Straight; this.tTurn = cRend.Texture_Turn; this.tIntersec = cRend.Texture_Intersection; this.tPixel = pixel; this.cursorLocation = new Vector2(0); }
// -------------------------------------------------------------------------- // METHODS // -------------------------------------------------------------------------- // Initialisation (de tout) protected override void Initialize() { base.Initialize(); spriteBatch = new SpriteBatch(this.GraphicsDevice); background = RenderTools.LoadTextureFromFile(this.GraphicsDevice, "Data\\damier.png"); robot = RenderTools.LoadTextureFromFile(this.GraphicsDevice, "Data\\robot.png"); cRend = new CircuitRenderer(iaVehicule.Circuit, this.GraphicsDevice); camera = new Camera(this.GraphicsDevice.Viewport); ia = new IADijkstra(this.iaVehicule); }
// -------------------------------------------------------------------------- // METHODS // -------------------------------------------------------------------------- // Initialise le Circuit, le CircuitRenderer, la Camera et le Cursor public void InitializeCircuit(NXTCircuit c = null) { if (c != null) { this.circuit = c; } tPixel = new Texture2D(this.GraphicsDevice, 1, 1); tPixel.SetData <Color>(new Color[] { Color.White }); cRend = new CircuitRenderer(circuit, this.GraphicsDevice); cursor = new Cursor(cRend, tPixel); camera = new Camera(this.GraphicsDevice.Viewport); initialized = true; }