コード例 #1
0
 public LivingObject()
     : base()
 {
     this.healthPoints    = 20;
     this.maxHealthPoints = 20;
     this.aggroRange      = 300;
     this.isDead          = false;
     tasks              = new List <LivingObjectTask>();
     aggroSystem        = new Task.Aggro.AggroSystem <LivingObject>();
     MovementSpeed      = 1f;
     currentTask        = null;
     this.canBeEffected = true;
     this.interactions  = new List <LivingObjectInteraction>();
     this.path          = null;
 }
コード例 #2
0
        public LivingObject(SerializationInfo info, StreamingContext ctxt)
            : base(info, ctxt)
        {
            this.healthPoints    = (float)info.GetValue("healthPoints", typeof(float));
            this.maxHealthPoints = (float)info.GetValue("maxHealthPoints", typeof(float));
            this.aggroRange      = (float)info.GetValue("aggroRange", typeof(float));

            this.isDead        = (bool)info.GetValue("isDead", typeof(bool));
            this.canBeEffected = (bool)info.GetValue("canBeEffected", typeof(bool));

            this.gender = (GenderEnum)info.GetValue("gender", typeof(GenderEnum));
            aggroSystem = new Task.Aggro.AggroSystem <LivingObject>();
            //tasks = new List<LivingObjectTask>();
            this.interactions = new List <LivingObjectInteraction>();

            //this.aggroSystem = (Task.Aggro.AggroSystem<LivingObject>)info.GetValue("aggroSystem", typeof(Task.Aggro.AggroSystem<LivingObject>));

            //TODO: Verändere Methoden, sodass Interaction und Tasks nicht mehr den Owner speichern, sonst gibt es eine Kettenspeicherung bei Serialisierung
            //this.interactions = (List<LivingObjectInteraction>)info.GetValue("interactions", typeof(List<LivingObjectInteraction>));

            //this.tasks = (List<LivingObjectTask>)info.GetValue("tasks", typeof(List<LivingObjectTask>));
        }