Exemple #1
0
        private static Rule[][] GenerateRules(MonoRandom rnd, ref FACScript FAC)
        {
            FAC.Audio.PlaySoundAtTransform("start", FAC.Module.transform);

            if (rnd.Seed == 1)
            {
                return(new Rule[0][]);
            }

            var rules = new Rule[2][] { new Rule[24], new Rule[8] };

            int[] ranges = { 10, 30 };

            for (int i = 0; i < rules.Length; i++)
            {
                for (int j = 0; j < rules[i].Length; j++)
                {
                    rules[i][j] = new Rule
                    {
                        Number = rnd.Next(ranges[i])
                    };
                }
            }

            return(rules);
        }
Exemple #2
0
 public Selectable(Calculate calculate, CoroutineScript coroutine, FACScript FAC, Init init, Render render)
 {
     this.calculate = calculate;
     this.coroutine = coroutine;
     this.FAC       = FAC;
     this.init      = init;
     this.render    = render;
 }
Exemple #3
0
        public Calculate(FACScript FAC, Init init)
        {
            this.FAC  = FAC;
            this.init = init;

            figureSequences   = new List <int>();
            sequences         = new List <bool?>();
            modifiedSequences = new List <bool>();
        }
Exemple #4
0
        public Init(CoroutineScript coroutine, FACScript FAC, TPScript TP)
        {
            moduleId = ++moduleIdCounter;

            this.coroutine = coroutine;
            this.FAC       = FAC;
            this.TP        = TP;

            calculate  = new Calculate(FAC, this);
            render     = new Render(calculate, FAC, this);
            selectable = new Selectable(calculate, coroutine, FAC, this, render);
        }
Exemple #5
0
        internal static int[] Apply(int[][] cylinders, FACScript FAC)
        {
            int[] cylinderValues = new int[3];
            int[] sumValues      = new int[3];

            for (int i = 0; i < cylinderValues.Length; i++)
            {
                cylinderValues[i] = Init.rules.GetLength(0) != 0 ? Init.rules[0][(i * 8) + Functions.GetColorIndex(i, FAC)].Number
                                                                 : Arrays.ColorTable[i, Functions.GetColorIndex(i, FAC)];

                for (int j = 0; j < cylinders[i].Length; j++)
                {
                    cylinders[i][j] += cylinderValues[i];
                }

                sumValues[i] = cylinders[i].Sum() % 10;
            }

            return(sumValues);
        }
Exemple #6
0
 public static int GetEdgework(int index, FACScript FAC)
 {
     if (index > 30 || index < 0)
     {
         throw new IndexOutOfRangeException("Arrays.GetEdgework recieved an out-of-range number: " + index + ".");
     }
     return(new[]
     {
         FAC.Info.GetBatteryCount(),
         FAC.Info.GetBatteryCount(Battery.AA) + FAC.Info.GetBatteryCount(Battery.AAx3) + FAC.Info.GetBatteryCount(Battery.AAx4),
         FAC.Info.GetBatteryCount(Battery.D),
         FAC.Info.GetBatteryHolderCount(),
         FAC.Info.GetIndicators().Count(),
         FAC.Info.GetOnIndicators().Count(),
         FAC.Info.GetOffIndicators().Count(),
         FAC.Info.GetPortPlateCount(),
         FAC.Info.GetPorts().Distinct().Count(),
         FAC.Info.GetPorts().Count() - FAC.Info.GetPorts().Distinct().Count(),
         FAC.Info.GetPortCount(),
         FAC.Info.GetSerialNumberNumbers().First(),
         FAC.Info.GetSerialNumberNumbers().Last(),
         FAC.Info.GetSerialNumberNumbers().Count(),
         FAC.Info.GetSerialNumberLetters().Count(),
         FAC.Info.GetSolvedModuleNames().Count(),
         FAC.Info.GetSolvedModuleNames().Where(m => !Ignore.Contains(m)).Count(),
         FAC.Info.GetModuleNames().Count(),
         FAC.Info.GetSolvableModuleNames().Count() - FAC.Info.GetSolvedModuleNames().Count(),
         FAC.Info.GetSolvedModuleNames().Where(m => Ignore.Contains(m)).Count(),
         int.Parse(FAC.NixieTexts[0].text),
         int.Parse(FAC.NixieTexts[1].text),
         int.Parse(FAC.GearText.text),
         FAC.init.stage + 1,
         int.Parse(FAC.DisplayText.text[0].ToString()),
         int.Parse(FAC.DisplayText.text[1].ToString()),
         int.Parse(FAC.DisplayText.text[2].ToString()),
         int.Parse(FAC.DisplayText.text[3].ToString()),
         int.Parse(FAC.DisplayText.text[4].ToString()),
         int.Parse(FAC.DisplayText.text[5].ToString())
     }[index]);
 }
Exemple #7
0
 public Render(Calculate calculate, FACScript FAC, Init init)
 {
     this.calculate = calculate;
     this.FAC       = FAC;
     this.init      = init;
 }
Exemple #8
0
 public static int GetColorIndex(int i, FACScript FAC)
 {
     return(Array.IndexOf(FAC.ColorTextures, FAC.ColoredObjects[i].material.mainTexture));
 }