Exemple #1
0
 private void Mobs_Attach(Mobs entity)
 {
     this.SendPropertyChanging();
     entity.MobTypes = this;
 }
Exemple #2
0
 private void Mobs_Detach(Mobs entity)
 {
     this.SendPropertyChanging();
     entity.MobTypes = null;
 }
Exemple #3
0
        public static Mob CreateMob(Mobs dbMob, MobTypeSet mobTypes)
        {
            Mob mob = new Mob();

            mob.m_room_key = new RoomKey(dbMob.GameID, dbMob.RoomX, dbMob.RoomY, dbMob.RoomZ);
            mob.m_mob_id = dbMob.MobID;
            mob.m_mob_type= mobTypes.GetMobTypeById(dbMob.MobTypeID);
            mob.m_position = new Point3d((float)dbMob.X, (float)dbMob.Y, (float)dbMob.Z);
            mob.m_angle = (float)dbMob.Angle;
            mob.m_health = dbMob.Health;
            mob.m_energy = dbMob.Energy;
            mob.m_ai_data = ParseJsonAIData(dbMob.AiData);

            if (mob.m_ai_data == null)
            {
                mob.m_ai_data = new MobAIState();
                //Utilities.LogWarning(string.Format("Mob:CreateMob(id={0}) - Unable to parse AI State. Creating new state.", dbMob.MobID));
            }

            return mob;
        }