Beispiel #1
0
        public static bool sameBaseMessage(Message m1, Message m2)
        {
            if(m1.message.Count != m2.message.Count)
            {
                return false;
            }

            bool test = true;

            for (int i = 0; i < m1.message.Count; i ++)
            {
                if(m1.message[i] != m2.message[i])
                {
                    test = false;
                    break;
                }
            }

            return test && m1.color == m2.color;
        }
Beispiel #2
0
 public static void newMessage(Message message)
 {
     newMessages.Add(message);
     gameLog.Add(message);
 }
Beispiel #3
0
        static Message getStringToDraw(ref int i, ref int stringsToDraw)
        {
            int j = 0;
            do
            {
                j++;
            }while((gameLog.Count > i + j && gameLog[gameLog.Count - i] == gameLog[gameLog.Count - i - j]));

            Message message;
            if (j != 1)
            {
                List<string> help = new List<string>();
                help.AddRange(gameLog[gameLog.Count - i].message);
                help.Add(" x" + j.ToString());
                message = new Message(help, gameLog[gameLog.Count - i].filler, gameLog[gameLog.Count - i].color);
            }
            else
            {
                message = gameLog[gameLog.Count - i];
            }

            stringsToDraw += j - 1;
            i += j - 1;
            return message;
        }