public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
        {
            m_subsystemGameInfo           = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
            m_subsystemParticles          = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
            m_subsystemAudio              = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
            m_subsystemTime               = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
            m_subsystemTerrain            = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
            m_subsystemPickables          = base.Project.FindSubsystem <SubsystemPickables>(throwOnError: true);
            m_componentGui                = base.Entity.FindComponent <ComponentGui>(throwOnError: true);
            m_componentHumanModel         = base.Entity.FindComponent <ComponentHumanModel>(throwOnError: true);
            m_componentBody               = base.Entity.FindComponent <ComponentBody>(throwOnError: true);
            m_componentOuterClothingModel = base.Entity.FindComponent <ComponentOuterClothingModel>(throwOnError: true);
            m_componentVitalStats         = base.Entity.FindComponent <ComponentVitalStats>(throwOnError: true);
            m_componentLocomotion         = base.Entity.FindComponent <ComponentLocomotion>(throwOnError: true);
            m_componentPlayer             = base.Entity.FindComponent <ComponentPlayer>(throwOnError: true);
            SteedMovementSpeedFactor      = 1f;
            Insulation                    = 0f;
            LeastInsulatedSlot            = ClothingSlot.Feet;
            m_clothes[ClothingSlot.Head]  = new List <int>();
            m_clothes[ClothingSlot.Torso] = new List <int>();
            m_clothes[ClothingSlot.Legs]  = new List <int>();
            m_clothes[ClothingSlot.Feet]  = new List <int>();
            ValuesDictionary value = valuesDictionary.GetValue <ValuesDictionary>("Clothes");

            SetClothes(ClothingSlot.Head, HumanReadableConverter.ValuesListFromString <int>(';', value.GetValue <string>("Head")));
            SetClothes(ClothingSlot.Torso, HumanReadableConverter.ValuesListFromString <int>(';', value.GetValue <string>("Torso")));
            SetClothes(ClothingSlot.Legs, HumanReadableConverter.ValuesListFromString <int>(';', value.GetValue <string>("Legs")));
            SetClothes(ClothingSlot.Feet, HumanReadableConverter.ValuesListFromString <int>(';', value.GetValue <string>("Feet")));
            Display.DeviceReset += Display_DeviceReset;
        }
Esempio n. 2
0
        public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
        {
            base.Load(valuesDictionary, idToEntityMap);
            m_subsystemGameInfo         = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
            m_subsystemTime             = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
            m_subsystemAudio            = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
            m_subsystemPickables        = base.Project.FindSubsystem <SubsystemPickables>(throwOnError: true);
            m_subsystemTerrain          = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
            ComponentGui                = base.Entity.FindComponent <ComponentGui>(throwOnError: true);
            ComponentInput              = base.Entity.FindComponent <ComponentInput>(throwOnError: true);
            ComponentScreenOverlays     = base.Entity.FindComponent <ComponentScreenOverlays>(throwOnError: true);
            ComponentBlockHighlight     = base.Entity.FindComponent <ComponentBlockHighlight>(throwOnError: true);
            ComponentAimingSights       = base.Entity.FindComponent <ComponentAimingSights>(throwOnError: true);
            ComponentMiner              = base.Entity.FindComponent <ComponentMiner>(throwOnError: true);
            ComponentRider              = base.Entity.FindComponent <ComponentRider>(throwOnError: true);
            ComponentSleep              = base.Entity.FindComponent <ComponentSleep>(throwOnError: true);
            ComponentVitalStats         = base.Entity.FindComponent <ComponentVitalStats>(throwOnError: true);
            ComponentSickness           = base.Entity.FindComponent <ComponentSickness>(throwOnError: true);
            ComponentFlu                = base.Entity.FindComponent <ComponentFlu>(throwOnError: true);
            ComponentLevel              = base.Entity.FindComponent <ComponentLevel>(throwOnError: true);
            ComponentClothing           = base.Entity.FindComponent <ComponentClothing>(throwOnError: true);
            ComponentOuterClothingModel = base.Entity.FindComponent <ComponentOuterClothingModel>(throwOnError: true);
            int playerIndex = valuesDictionary.GetValue <int>("PlayerIndex");

            PlayerData = base.Project.FindSubsystem <SubsystemPlayers>(throwOnError: true).PlayersData.First((PlayerData d) => d.PlayerIndex == playerIndex);
        }