/* * Structure.cs * Authors: August Zinsser * * Copyright Matthew Belmonte 2007 */ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Storage; using tAC_Engine; using Pina3D; namespace Astropolis.ColonySimulator { /// /// A basic structure instance in the colony simulator. /// public class Structure : IDisposable { protected StructureType mType; // Stores the blueprints for this type of structure protected StructureState mState; // Stores instance-specific data /// /// Create a new Structure /// public Structure(StructureType type, StructureState state) { mState = state; Pina.AddRenderable(type.Model); } protected Structure() { } public virtual void Dispose() { Pina.RemoveRenderable(mType.Model); mState = null; } public virtual void Update(float dT) { } } public class StructureState { /// /// The rendering transform to draw this model /// public Matrix Matrix; /// /// The grid location and size of this instance /// public Rectangle BoundingBox; public StructureState(Matrix matrix, Rectangle boundingBox) { this.Matrix = matrix; this.BoundingBox = boundingBox; } } public class StructureType { /// /// The 3D model associated with this structure /// public PinaModel Model; /// /// The width of the building's fooprint on the level grid /// public int FootprintWidth; /// /// The height of the building's fooprint on the level grid /// public int FootprintHeight; public StructureType(PinaModel model, int footprintWidth, int footprintHeight) { this.Model = model; this.FootprintWidth = footprintWidth; this.FootprintHeight = footprintHeight; } } }