public void RegisterEntityWithBehaviourOfType(GameEntity entity, EntityBehaviourType behaviourType)
        {
            EntityBehaviour behaviour = behaviourRepository.Get(behaviourType);

            if (behaviour != null)
            {
                behaviour.RegisterEntityWithBehaviour(entity);
            }
        }
Esempio n. 2
0
 public void AddBehaviours(GameEntity entity, EntityDefinition definition)
 {
     for (int i = 0; i < definition.requiredBehaviours.Count; i++)
     {
         if (entity.RepositoryContains(definition.requiredBehaviours[i].behaviourType))
         {
             continue;
         }
         else
         {
             EntityBehaviour behaviour = AddBehaviourOfType(entity, definition.requiredBehaviours[i].behaviourType);
             behaviour.ConfigureFromDefinition(definition.requiredBehaviours[i]);
             entity.AddBehaviour(behaviour);
         }
     }
 }
 public override void Load(EntityBehaviour load)
 {
 }
 public void AddBehaviour(EntityBehaviour behaviour)
 {
     behaviourRepository.Add(behaviour);
 }