public List<GameObject> GetObjects(ref PhysicsEnvironment environment)
{
var objects = new List<GameObject>();
foreach (var entity in _mEntities)
{
//If the object is static, make a static object
if (entity.MType == XmlKeys.StaticObject)
{
var tile = new Tile(_mContent, .8f, entity);
objects.Add(tile);
}
//If the object is physics, make a physics object
if (entity.MType == XmlKeys.PhysicsObject)
{
if (entity.MProperties.ContainsKey("Rail") && entity.MProperties.ContainsKey("Length"))
_mRails.Add(entity);
var isSquare = entity.MProperties.ContainsKey("Shape") && entity.MProperties["Shape"] == "Square";
float mass = 1;
if (entity.MProperties.ContainsKey("Mass"))
{
mass = (float)Convert.ToDouble(entity.MProperties["Mass"]);
}
if (entity.MProperties.ContainsKey(XmlKeys.Reverse))
{
var rTile = new ReverseTile(_mContent, ref environment, 0.8f, entity);
rTile.Mass = mass;
objects.Add(rTile);
}
else
{
var mTile = new MovingTile(_mContent, ref environment, 0.8f, entity);
mTile.Mass = mass;
objects.Add(mTile);
}
}
}
return objects;
}