Beispiel #1
0
        public void LoadFromData()
        {
            StatusData entry = DataManager.Instance.GetStatus(ID);

            foreach (StatusState state in entry.StatusStates)
            {
                if (!StatusStates.Contains(state.GetType()))
                {
                    StatusStates.Set(state.Clone <StatusState>());
                }
            }
        }
        public void AddContextStateInt <T>(bool global, int addedVal) where T : ContextIntState
        {
            ContextIntState countState = global ? GlobalContextStates.GetWithDefault <T>() : ContextStates.GetWithDefault <T>();

            if (countState == null)
            {
                T newCount = (T)Activator.CreateInstance(typeof(T));
                newCount.Count = addedVal;
                if (global)
                {
                    GlobalContextStates.Set(newCount);
                }
                else
                {
                    ContextStates.Set(newCount);
                }
            }
            else
            {
                countState.Count += addedVal;
            }
        }
Beispiel #3
0
        public void LoadFromData()
        {
            MapStatusData entry = DataManager.Instance.GetMapStatus(ID);

            foreach (MapStatusState state in entry.StatusStates)
            {
                if (!StatusStates.Contains(state.GetType()))
                {
                    StatusStates.Set(state.Clone <MapStatusState>());
                }
            }

            Emitter = (SwitchOffEmitter)entry.Emitter.Clone();//Clone Use Case; convert to Instantiate?
            Hidden  = entry.DefaultHidden;
        }