/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent( ) { //Loads all the building images at the start of the game AssetManager.getInstance().addTexture(Content.Load<Texture2D>("Textures/Tower"), "Tower"); AssetManager.getInstance().addTexture(Content.Load<Texture2D>("Textures/Wall"), "Wall"); AssetManager.getInstance().addTexture(Content.Load<Texture2D>("Textures/Factory"), "Factory"); // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch ( GraphicsDevice ); _unitTex = Content.Load< Texture2D >( "Textures/Unit" ); _dottedLineTex = Content.Load<Texture2D>("Textures/DottedLine"); _Emitter.setUp ( _unitTex, new Vector2 ( 100.0f, 100.0f ) ); _BuildingManager = new BuildingManager(); _unitOne = new BaseUnit ( ); _unitOne.Texture = _unitTex; _selection = new Selection(_BuildingManager); _selection.Texture = _dottedLineTex; _InputManager = new InputManager(_BuildingManager, _selection); }
//initialises stuff public Selection(BuildingManager BuildingManager) { _SelectionBox = new Rectangle(0, 0, 0, 0); m_lSelectedUnits = new List<BaseUnit>(); _BuildingManager = BuildingManager; }
//Pass the different classes that need input from a keyboard to this class public InputManager(BuildingManager _BuildingManager, Selection _Selection) { _mBuildingManager = _BuildingManager; _mSelection = _Selection; }