public void Add(object obj)
 {
     if (NonCollidables == null)
     {
         NonCollidables = new List <Sprite>();
     }
     NonCollidables.Add((Sprite)obj);
 }
Esempio n. 2
0
 private void LoadNonCollidables()
 {
     foreach (ObjectsNode node in nonCollidableList)
     {
         Type    t = Type.GetType(node.ObjectType);
         Vector2 position;
         position.X = node.Position.X;
         position.Y = node.Position.Y;
         var obj = Activator.CreateInstance(t, position);
         NonCollidables.Add((IObject)obj);
     }
 }
Esempio n. 3
0
 private void LoadNonCollidables()
 {
     nonCollidableList = XMLUtility.XMLReader <ObjectsNode>(StringConsts.NoncollidablesFile);
     foreach (ObjectsNode node in nonCollidableList)
     {
         Type    t = Type.GetType(node.ObjectType);
         Vector2 position;
         position.X = node.Position.X;
         position.Y = node.Position.Y;
         var obj = Activator.CreateInstance(t, position);
         NonCollidables.Add((IObject)obj);
     }
 }