Example #1
0
        public void Color(IEgg egg, IBunny bunny)
        {
            IDye dye = null;

            while (!egg.IsDone())
            {
                if (dye == null || dye.IsFinished())
                {
                    dye = bunny.Dyes.FirstOrDefault(d => d.Power > 0);

                    if (dye == null)
                    {
                        break;
                    }
                }
                dye.Use();
                bunny.Work();
                egg.GetColored();

                if (bunny.Energy == 0)
                {
                    break;
                }
            }
        }
Example #2
0
        public static void SetFavorite(IDye item, bool favorite)
        {
            if (Instance.Current == null)
            {
                return;
            }

            bool isFavorite = IsFavorite(item);

            if (favorite == isFavorite)
            {
                return;
            }

            if (favorite)
            {
                Instance.Current.Dyes.Add(item);
            }
            else
            {
                Instance.Current.Dyes.Remove(item);
            }

            Instance.RaisePropertyChanged(nameof(Favorites.Items));
            Save();
        }
Example #3
0
        public static bool IsFavorite(IDye item)
        {
            if (Instance.Current == null)
            {
                return(false);
            }

            return(Instance.Current.Dyes.Contains(item));
        }
Example #4
0
        public void Color(IEgg egg, IBunny bunny)   ///problemmm
        {
            while (egg.IsDone() == false && bunny.Energy > 0 && bunny.Dyes.Any(x => x.IsFinished() == false))
            {
                egg.GetColored();

                bunny.Work();
                IDye dye = bunny.Dyes.FirstOrDefault(x => x.IsFinished() == false);

                dye.Use();
            }
        }
Example #5
0
        private static CharacterFile.ItemSave GearFromItem(IItem item, IDye dye)
        {
            CharacterFile.ItemSave save = new CharacterFile.ItemSave();

            save.ModelBase    = item.ModelBase;
            save.ModelVariant = (byte)item.ModelVariant;

            if (dye != null)
            {
                save.DyeId = dye.Id;
            }

            return(save);
        }
Example #6
0
        public void Color(IEgg egg, IBunny bunny)
        {
            while (bunny.Energy > 0 && bunny.Dyes.Any(d => d.Power > 0))
            {
                if (egg.IsDone())
                {
                    break;
                }

                IDye d = bunny.Dyes.FirstOrDefault(x => x.Power > 0);
                d.Use();
                bunny.Work();
                egg.GetColored();
            }
        }
Example #7
0
        private static CharacterFile.WeaponSave WeaponFromItem(IItem item, IDye dye)
        {
            CharacterFile.WeaponSave save = new CharacterFile.WeaponSave();

            save.Color        = Color.White;
            save.Scale        = Vector.One;
            save.ModelSet     = item.ModelSet;
            save.ModelBase    = item.ModelBase;
            save.ModelVariant = item.ModelVariant;

            if (dye != null)
            {
                save.DyeId = dye.Id;
            }

            return(save);
        }
Example #8
0
        public void Color(IEgg egg, IBunny bunny)
        {
            while (egg.IsDone() == false)
            {
                if (bunny.Energy == 0 || bunny.Dyes.All(x => x.IsFinished()))
                {
                    break;
                }

                IDye dye = (IDye)bunny.Dyes.First();
                dye.Use();
                egg.GetColored();
                bunny.Work();

                if (dye.IsFinished())
                {
                    bunny.Dyes.Remove(dye);
                }
            }
        }
Example #9
0
        public void Color(IEgg egg, IBunny bunny)
        {
            while (bunny.Energy > 0 && bunny.Dyes.Any())
            {
                IDye currentEgg = bunny.Dyes.First();

                while (!egg.IsDone() && bunny.Energy > 0 && !currentEgg.IsFinished())
                {
                    egg.GetColored();
                    bunny.Work();
                    currentEgg.Use();
                }

                if (currentEgg.IsFinished())
                {
                    bunny.Dyes.Remove(currentEgg);
                }

                if (egg.IsDone())
                {
                    break;
                }
            }
        }
Example #10
0
 public void Color(IEgg egg, IBunny bunny)
 {
     while (true)
     {
         if (bunny.Energy == 0)
         {
             break;
         }
         if (bunny.Dyes.All(x => x.IsFinished() == true))
         {
             break;
         }
         IDye currentDye = bunny.Dyes.FirstOrDefault(x => x.IsFinished() == false);
         while (true)
         {
             if (currentDye.IsFinished())
             {
                 break;
             }
             currentDye.Use();
             bunny.Work();
             egg.GetColored();
             if (egg.IsDone())
             {
                 break;
             }
         }
         //currentDye.Use();
         //bunny.Work();
         //egg.GetColored();
         if (egg.IsDone())
         {
             break;
         }
     }
 }
Example #11
0
 public void AddDye(IDye dye)
 {
     dyes.Add(dye);
 }
Example #12
0
 public void AddDye(IDye dye)
 {
     this.Dyes.Add(dye);
 }
Example #13
0
 public void AddDye(IDye dye)
 {
     //TODO: Check if dye is null!
     dyes.Add(dye);
 }