Ejemplo n.º 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>());
                }
            }
        }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 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;
        }