Exemple #1
0
 public virtual void NotifyMasterLifeForm(NotificationType aNotifyType, LifeForm aLifeForm)
 {
     if (_Master != null)
     {
         _Master.NotifyMasterLifeForm(aNotifyType, aLifeForm);
     }
     else
     {
         ManageMasterNotification(aNotifyType, aLifeForm);
     }
 }
        public override void ManageMasterNotification(NotificationType aNotifyType, LifeForm aLifeForm)
        {
            switch (aNotifyType)
            {
            case Life.NotificationType.Born:
                if (!ManagedOnes.ContainsValue(aLifeForm))
                {
                    ManagedOnes.Add(aLifeForm.dna.Id, aLifeForm);
                }
                break;

            case Life.NotificationType.Dead:
                if (ManagedOnes.ContainsValue(aLifeForm))
                {
                    ManagedOnes.Remove(aLifeForm.dna.Id);
                }
                break;
            }
        }
 public EnvironmentLifeForm(LifeForm aMaster, LifeFormTypes aLifeFormType, DNASequence aDna)
     : base(aMaster, aLifeFormType, aDna)
 {
     BeginMainTask();
 }
 public EnvironmentLifeForm(LifeForm aMaster, LifeFormTypes aLifeFormType)
     : base(aMaster, aLifeFormType)
 {
     BeginMainTask();
 }
 public EnvironmentLifeForm(LifeForm aMaster)
     : base(aMaster, LifeFormTypes.EnvironmentEntity)
 {
     BeginMainTask();
 }
 public override void NotifyMasterLifeForm(NotificationType aNotifyType, LifeForm aLifeForm)
 {
     ManageMasterNotification(aNotifyType, aLifeForm);
     base.NotifyMasterLifeForm(aNotifyType, aLifeForm);
 }
Exemple #7
0
 public LifeForm(LifeForm aMaster, LifeFormTypes aLifeFormType, DNASequence aDna)
 {
     _Master = aMaster;
     LfType  = aLifeFormType;
     ReGenerateADN(aLifeFormType, aDna);
 }
Exemple #8
0
 public LifeForm(LifeForm aMaster, LifeFormTypes aLifeFormType)
 {
     _Master = aMaster;
     LfType  = aLifeFormType;
     ReGenerateADN(aLifeFormType, null);
 }
Exemple #9
0
 public virtual void ManageMasterNotification(NotificationType aNotifyType, LifeForm aLifeForm)
 {
 }
Exemple #10
0
 public FoodLifeForm(LifeForm aMaster, LifeFormTypes aLifeFormType, DNASequence aDna)
     : base(aMaster, aLifeFormType, aDna)
 {
     FoodValue = GetAttribute(SkillTypes.FoodProductionRate);
     BeginMainTask();
 }
Exemple #11
0
 public FoodLifeForm(LifeForm aMaster)
     : base(aMaster, LifeFormTypes.FoodTypeLifeForm)
 {
     FoodValue = GetAttribute(SkillTypes.FoodProductionRate);
     BeginMainTask();
 }