/// <summary>
        ///
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public StatePart Create(StatePartTypeEnum type, BinaryReader reader)
        {
            StatePart part = null;

            switch (type)
            {
            case StatePartTypeEnum.GAME_OBJECT: part = new GameObjectPart(); break;

            case StatePartTypeEnum.MOVABLE_ENTITY: part = new MovableEntityPart(); break;

            case StatePartTypeEnum.COMBAT_ENTITY: part = new CombatEntityPart(); break;

            case StatePartTypeEnum.HERO_ENTITY: part = new HeroEntityPart(); break;

            case StatePartTypeEnum.PHYSIC_OBJECT: part = new PhysicObjectPart(); break;

            default: throw new ArgumentException("unknow state part type id : " + type);
            }
            try {
                part.FromNetwork(reader);
            }
            catch (Exception e)
            {
                throw new StatePartDeserializationException("unable to deserialize part : " + part.Type, e);
            }
            return(part);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="reader"></param>
        public override void FromNetwork(BinaryReader reader)
        {
            base.FromNetwork(reader);

            var combatPart = new CombatEntityPart();
            combatPart.FromNetwork(reader);
            UpdateCombatEntityPart(combatPart);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="part"></param>
 public void UpdateCombatEntityPart(CombatEntityPart part)
 {
     SetMaxLife(part.MaxLife);
     SetLife(part.CurrentLife);
 }