Ejemplo n.º 1
0
        private static void CreateEntitiesInArray()
        {
            for (int i = 0; i < numberOfEntities; i++)
            {
                PhysicsComponent p = new PhysicsComponent();
                AIComponent ai = new AIComponent();
                RenderComponent r = new RenderComponent();

                _physicsComponents[i] = p;
                _aiComponents[i] = ai;
                _renderComponents[i] = r;

                GameEntity g = new GameEntity(p, ai, r);
                _entities[i] = g;
            }
        }
Ejemplo n.º 2
0
        private static void CreateEntitiesInArray()
        {
            for (int i = 0; i < numberOfEntities; i++)
            {
                PhysicsComponent p  = new PhysicsComponent();
                AIComponent      ai = new AIComponent();
                RenderComponent  r  = new RenderComponent();

                _physicsComponents[i] = p;
                _aiComponents[i]      = ai;
                _renderComponents[i]  = r;

                GameEntity g = new GameEntity(p, ai, r);
                _entities[i] = g;
            }
        }
Ejemplo n.º 3
0
 // for this to work, the components should be passed as pointers
 // this is NOT possible in C#
 // can use pass by reference or unsafe context ... but still not the same as in C++
 public GameEntity(PhysicsComponent physics, AIComponent ai, RenderComponent render)
 {
     Physics = physics;
     Ai = ai;
     Render = render;
 }
Ejemplo n.º 4
0
 // for this to work, the components should be passed as pointers
 // this is NOT possible in C#
 // can use pass by reference or unsafe context ... but still not the same as in C++
 public GameEntity(PhysicsComponent physics, AIComponent ai, RenderComponent render)
 {
     Physics = physics;
     Ai      = ai;
     Render  = render;
 }