Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Entity : public Engine
- {
- protected:
- //…
- public:
- //…
- virtual void Physics()
- {
- //Default physics.//
- }
- virtual void Other(){}//Could be used for AI.
- };
- struct DefaultAI
- {
- void AIDefault()
- {
- //Default AI behavior.//
- }
- };
- class FirstAI: public Entity, public DefaultAI
- {
- //…
- public:
- //…
- void Other()
- {
- //The AI most of the AI’s would have.
- Default();
- }
- };
- class SecondAI: public Entity
- {
- //…
- public:
- //…
- void Other()
- {
- //New AI behavior.//
- }
- void Physics()
- {
- //New physics.//
- }
- };
- //Could be in the singleton.//
- static void Shared( Entity *ent )
- {
- ent->Physics();
- ent->Other();
- }
- class Single
- {
- std::vector objects;
- public:
- void Instantiate( std::string what )
- {
- //…
- }
- void Update()
- {
- //Somewhere in the engines cycle.//
- Shared( objects[i] );
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement