/*
* GridComponent.cs
* Authors: Bradley R. Blankenship
* Copyright (c) 2007-2008 Cornell University
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using tAC_Engine.Graphics.Entities;
namespace ColonySim
{
///
/// Represents a component that can be referenced by the Grid.
///
internal abstract class GridComponent : EntityModel
{
#region Fields
// The position on the grid of the component
Point mPosition;
// A reference back to the grid
Grid mGridReference;
#endregion
#region Properties
///
/// The position on the Grid.
///
public Point GridPosition
{
get { return mPosition; }
set { mPosition = value; }
}
///
/// The reference to the Grid we are using
///
protected Grid GridReference
{
get { return mGridReference; }
}
#endregion
#region Constructs
///
/// Basic constructor
///
/// The content manager
/// The model path
/// The texture path
protected GridComponent(ContentManager pContent, string pModelPath, string pTexturePath)
: base(pContent, pModelPath, pTexturePath)
{
// Create the position
mPosition = new Point();
}
#endregion
#region Behavior
///
/// Register this GridComponent with the grid.
///
/// The Grid to register with.
public void Register(Grid pGrid)
{
// Register us with the given grid
mGridReference = pGrid;
}
///
/// Called whenever an object in the game needs to update, based on the
/// given update time.
///
public abstract void Tick();
#endregion
}
}