Esempio n. 1
0
        internal static void ToLog(this String[] strings, UpdogScript updog, IntTuple pos)
        {
            updog.Log("Notice: The coordinates used are formatted as (x,y) and are 0-indexed.");
            updog.Log("The maze is as follows: (S = start, x = bone)");

            string[] logs = new string[strings.Length];

            for (int i = 0; i < strings.Length; i++)
            {
                logs[i] = strings[i].ToString()
                          .Select((c, j) => pos.Item1 == i && pos.Item2 == j ? 'S'
                    : char.IsUpper(c) ? ' ' : c).Join("");
            }

            if (Application.isEditor)
            {
                updog.Log('\n' + logs.Join("\n"));
            }
            else
            {
                foreach (var log in logs)
                {
                    updog.Log(log);
                }
            }
        }
Esempio n. 2
0
        internal static bool IsValidMove(this String[] strings, UpdogScript updog, ref IntTuple pos, int i)
        {
            IntTuple intercept;

            ApplyMovement(ref pos, out intercept, i);

            if (pos.Item1 < 0 || pos.Item1 >= Mazes.MaxLength ||
                pos.Item2 < 0 || pos.Item2 >= Mazes.MaxLength)
            {
                updog.Log("The dog fell out of bounds ({0},{1}), strike for incompetence!"
                          .Form(pos.Item1.ElevenToFiveIndex(), pos.Item2.ElevenToFiveIndex()));
            }

            else if (WallCharacters.Contains(strings[intercept.Item1][intercept.Item2]))
            {
                updog.Log("The dog hit a wall, strike for animal cruelty!");
            }

            else
            {
                return(true);
            }

            return(false);
        }
Esempio n. 3
0
 internal static void ToLog(this bool[] order, UpdogScript updog)
 {
     updog.Log("Press the buttons in the order of ({0}), where D is a dog button, and N is a normal button."
               .Format((object)order.Select(b => b ? "D" : "N").Join("")));
 }
Esempio n. 4
0
 internal static void ToLog(this IntTuple pos, UpdogScript updog)
 {
     updog.Log("The starting position is ({0},{1})."
               .Format(pos.Item2.ElevenToFiveIndex(), pos.Item1.ElevenToFiveIndex()));
 }