2012-03-24 23:06:51 +00:00
|
|
|
|
using Axios.Engine.Interfaces;
|
|
|
|
|
using FarseerPhysics.Dynamics;
|
2012-03-19 23:57:59 +00:00
|
|
|
|
using FarseerPhysics.SamplesFramework;
|
|
|
|
|
using Microsoft.Xna.Framework;
|
2012-04-16 00:17:34 +00:00
|
|
|
|
using GameStateManagement;
|
2012-03-19 23:57:59 +00:00
|
|
|
|
|
|
|
|
|
namespace Axios.Engine
|
|
|
|
|
{
|
|
|
|
|
public abstract class AxiosGameObject : AxiosEvents, IAxiosGameObject
|
|
|
|
|
{
|
|
|
|
|
protected float _scale = 1f;
|
|
|
|
|
protected bool removing = false;
|
|
|
|
|
|
|
|
|
|
public float Scale
|
|
|
|
|
{
|
|
|
|
|
get { return _scale; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _scale)
|
|
|
|
|
{
|
|
|
|
|
_scale = value;
|
|
|
|
|
OnScaleChange(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string _name;
|
|
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return this._name;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
this._name = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public virtual void Update(AxiosGameScreen gameScreen, Microsoft.Xna.Framework.GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void LoadContent(AxiosGameScreen gameScreen)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2012-04-16 00:17:34 +00:00
|
|
|
|
public virtual void HandleInput(AxiosGameScreen gameScreen, InputState input, GameTime gameTime)
|
2012-03-19 23:57:59 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2012-04-16 00:17:34 +00:00
|
|
|
|
public virtual void HandleCursor(AxiosGameScreen gameScreen, InputState input)
|
2012-03-19 23:57:59 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void UnloadContent(AxiosGameScreen gameScreen)
|
|
|
|
|
{
|
|
|
|
|
RemoveEvents();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Remove()
|
|
|
|
|
{
|
|
|
|
|
this.OnRemove(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void SetCollideWithAll(Body b)
|
|
|
|
|
{
|
|
|
|
|
if (b != null)
|
|
|
|
|
{
|
|
|
|
|
b.CollidesWith = Category.All;
|
|
|
|
|
b.CollisionCategories = Category.All;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return this._name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|