/// <summary> /// Default constructor for an un-positioned gridspace /// </summary> /// <param name="parentGrid">Grid of which to be a technical, but undrawn and inaccessible, member.</param> public GridSpace(Grid parentGrid) { currentActor = null; isOccupied = false; moveCost = 1; parent = parentGrid; walls = new Wall[3]; }
/// <summary> /// Creates a grid space that considers itself at position (posX, posY) in the parent grid. /// </summary> /// <param name="spaceTypeSelector">Chooses the texture for this space. Does not affect the properties of it otherwise.</param> /// <param name="posX">Horizontal position in the grid</param> /// <param name="posY">Vertical position in the grid</param> /// <param name="elevation"></param> /// <param name="Parent"></param> public GridSpace(int spaceTypeSelector, int posX, int posY, int elevation, Grid Parent) { EnvironmentTextureHolder holder = EnvironmentTextureHolder.Holder; currentActor = null; isOccupied = false; moveCost = 1; parent = Parent; projectilesInSpace = new List<SpaceProjectile>(); gridPos = new Vector2(posX, posY); spaceSprite = holder.MainHexagonSprites[spaceTypeSelector].copySprite(); minimapSprite = holder.MinimapHexagonSprites[spaceTypeSelector].copySprite(); spaceType = spaceTypeSelector; walls = new Wall[3]; for (int i = 0; i < 3; ++i) { walls[i] = new Wall(); } this.elevation = elevation; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); ConstantHolder.textureLoader = TextureListXML.loadTextureXMLs("Content\\XMLs\\Textures\\Textures.xml"); ActorHolder = ActorTextureHolder.makeHolder(GraphicsDevice); CombatHolder = CombatTextureHolder.makeHolder(GraphicsDevice); EnviroHolder = EnvironmentTextureHolder.makeHolder(GraphicsDevice); InterfaceHolder = InterfaceTextureHolder.makeHolder(Content, GraphicsDevice); currentLevelGrid = Level.loadLevelXML("Content\\XMLs\\level.xml").LevelGrid; GUIMan = GUIManager.MakeManager(); changeState(GameState.Gameplay_Combat); //currentLevelGrid = thing.SimpleLevelGrid; IsMouseVisible = true; changeState(GameState.Gameplay_Combat); //HexagonWidth = hex.Width; // TODO: use this.Content to load your game content here }