예제 #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;
            }
        }
예제 #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;
            }
        }
예제 #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;
 }
예제 #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;
 }