Esempio n. 1
0
        public static void AddBird(Bird b)
        {
            foreach (var old in birds)
            {
                if (old.cHead == b.cHead && old.cTail == b.cTail && old.cTorso == b.cTorso && old.cWing == b.cWing && old.BeakType == b.BeakType)
                    return;
            }
            birds.Add(b);

            WriteStuff();
        }
Esempio n. 2
0
        public Bird CreateBird(Island i, Vector3 pos)
        {
            int beak = G.r.Next(5);

            Bird b = new Bird(i, pos);
            b.BeakType = beak;
            b.SetTexturesSide(sHead, sTorso, sTail, sLeg, sBeaks[beak], sWing);
            b.SetTexturesFront(fHead, fTorso, fLeg, fBeaks[beak], fWing);
            b.SetTexturesBack(bHead, bTorso, bLeg, bWing, bTail);
            Color baseColor = GenColor(Color.White);
            b.SetColors(GenColor(baseColor), GenColor(baseColor), baseColor, GenColor(baseColor));
            b.FinalizeBird();
            return b;
        }
Esempio n. 3
0
        static Encyclopedia()
        {
            try
            {
                var lines = File.ReadAllLines("encyclopedia.txt");
                foreach (var line in lines)
                {
                    try
                    {
                        var s = line.Split(':');
                        var head = ToColor(s[0]);
                        var tail = ToColor(s[1]);
                        var torso = ToColor(s[2]);
                        var wing = ToColor(s[3]);
                        var beak = int.Parse(s[4]);
                        var name = s.Length == 6 ? s[5] : "";

                        Bird b = new Bird(null, Vector3.Zero);
                        b.cHead = head;
                        b.cTail = tail;
                        b.cTorso = torso;
                        b.cWing = wing;
                        b.BeakType = beak;
                        b.Name = name;

                        birds.Add(b);
                    }
                    catch
                    {

                    }
                }
            }
            catch
            {

            }
        }
Esempio n. 4
0
 internal static void NameBird(Bird b, string name)
 {
     foreach (var old in birds)
     {
         if (old.cHead == b.cHead && old.cTail == b.cTail && old.cTorso == b.cTorso && old.cWing == b.cWing && old.BeakType == b.BeakType)
         {
             old.Name = name;
             WriteStuff();
         }
     }
 }
Esempio n. 5
0
 internal static string GetName(Bird b)
 {
     if (b == null) { return ""; }
     foreach (var old in birds)
     {
         if (old.cHead == b.cHead && old.cTail == b.cTail && old.cTorso == b.cTorso && old.cWing == b.cWing && old.BeakType == b.BeakType)
             return old.Name;
     }
     return "";
 }