Beispiel #1
0
        public static bool Edit(this UnnullableSTD <CountlessInt> uc, ValueIndex ind)
        {
            var tmp = uc.Get(ind);//[ind.groupIndex][ind.triggerIndex];

            if (pegi.edit(ref tmp))
            {
                uc.Set(ind, tmp);
                return(true);
            }
            return(false);
        }
Beispiel #2
0
        public static bool Select(this UnnullableSTD <CountlessInt> uc, Trigger t)
        {
            var tmp = uc.Get(t);

            if (pegi.select(ref tmp, t.enm))
            {
                uc.Set(t, tmp);
                return(true);
            }
            return(false);
        }
Beispiel #3
0
        public static void FindAllTriggerGroups()
        {
            all = new UnnullableSTD <TriggerGroup>();

            List <Type> triggerGroups = CsharpFuncs.GetAllChildTypesOf <TriggerGroup>();

            foreach (Type group in triggerGroups)
            {
                TriggerGroup s = (TriggerGroup)Activator.CreateInstance(group);
                Browsed = s;
            }
        }
Beispiel #4
0
        public TriggerGroup()
        {
            index = UnnullableSTD <TriggerGroup> .IndexOfCurrentlyCreatedUnnulable;

            triggers = new UnnullableSTD <Trigger>();

#if UNITY_EDITOR
            Type type = GetIntegerEnums();

            if (type != null)
            {
                string[] nms = Enum.GetNames(type);

                int[] indexes = (int[])Enum.GetValues(type);

                for (int i = 0; i < nms.Length; i++)
                {
                    Trigger tr = triggers[indexes[i]];

                    if (tr.name != nms[i])
                    {
                        tr._usage = TriggerUsage.number;
                        tr.name   = nms[i];
                    }
                }
            }

            //Boolean enums
            type = GetBooleanEnums();

            if (type != null)
            {
                string[] nms = Enum.GetNames(type);

                int[] indexes = (int[])Enum.GetValues(type);

                for (int i = 0; i < nms.Length; i++)
                {
                    Trigger tr = triggers[indexes[i]];

                    if (tr.name != nms[i])
                    {
                        tr._usage = TriggerUsage.boolean;
                        tr.name   = nms[i];
                    }
                }
            }
#endif
        }
Beispiel #5
0
        public void RemoveAllTags()
        {
            List <int>           groupInds;
            List <CountlessBool> lsts = boolTags.GetAllObjs(out groupInds);

            //Stories.all.GetAllObjs(out inds);

            for (int i = 0; i < groupInds.Count; i++)
            {
                CountlessBool vb  = lsts[i];
                List <int>    tag = vb.GetItAll();

                foreach (int t in tag)
                {
                    SetTagBool(groupInds[i], t, false);
                }
            }

            boolTags = new UnnullableSTD <CountlessBool>();
        }
Beispiel #6
0
 public static void Set(this UnnullableSTD <CountlessInt> uc, ValueIndex ind, int value) => uc[ind.groupIndex][ind.triggerIndex] = value;
Beispiel #7
0
 public static int Get(this UnnullableSTD <CountlessInt> uc, ValueIndex ind) => uc[ind.groupIndex][ind.triggerIndex];
Beispiel #8
0
 public static bool Get(this UnnullableSTD <CountlessBool> uc, ValueIndex ind) => uc[ind.groupIndex][ind.triggerIndex];