Esempio n. 1
0
 public void UpdateFurColor(HairFurColors primary, HairFurColors secondary, FurMulticolorPattern pattern)
 {
     primaryColor      = primary ?? throw new ArgumentNullException();
     alternateColor    = secondary ?? throw new ArgumentNullException();
     multiColorPattern = pattern;
     validateData();
 }
        internal static HairFurColors ToNearestSpineColor(HairFurColors currentColor, Tones currentSkinTone)
        {
            Color color = Color.FromArgb((currentColor.rgbValue.R + currentSkinTone.rgbValue.R) / 2, (currentColor.rgbValue.G + currentSkinTone.rgbValue.G) / 2,
                                         (currentColor.rgbValue.B + currentSkinTone.rgbValue.B) / 2);

            return(HairFurColors.NearestHairFurColor(color));
        }
Esempio n. 3
0
 public void UpdateFurColor(HairFurColors primary)
 {
     primaryColor      = primary ?? throw new ArgumentNullException();
     alternateColor    = HairFurColors.NO_HAIR_FUR;
     multiColorPattern = FurMulticolorPattern.NO_PATTERN;
     validateData();
 }
Esempio n. 4
0
 public static Tones NearestTone(HairFurColors currentHairFur)
 {
     //edge cases. they'll already do weird shit, so just randomize it.
     //you really should check for these first.
     if (currentHairFur == HairFurColors.RAINBOW || HairFurColors.IsNullOrEmpty(currentHairFur))
     {
         return(NOT_APPLICABLE);
     }
     return(NearestTone(currentHairFur));
 }
Esempio n. 5
0
 public void UpdateFurColor(FurColor other)
 {
     if (other == null)
     {
         throw new ArgumentNullException();
     }
     primaryColor      = other.primaryColor;
     alternateColor    = other.alternateColor;
     multiColorPattern = other.multiColorPattern;
     validateData();
 }
Esempio n. 6
0
        private void validateData()
        {
            if (HairFurColors.IsNullOrEmpty(primaryColor) && HairFurColors.IsNullOrEmpty(alternateColor))
            {
                primaryColor   = HairFurColors.NO_HAIR_FUR;
                alternateColor = HairFurColors.NO_HAIR_FUR;
            }
            if (HairFurColors.IsNullOrEmpty(primaryColor) && !HairFurColors.IsNullOrEmpty(alternateColor))
            {
                primaryColor   = alternateColor;
                alternateColor = HairFurColors.NO_HAIR_FUR;
            }

            if (primaryColor == alternateColor && primaryColor != HairFurColors.NO_HAIR_FUR)             //prevent weird "brown fur with brown spots" - that's just "brown fur".
            {
                alternateColor = HairFurColors.NO_HAIR_FUR;
            }

            if (!isMultiColored)
            {
                multiColorPattern = FurMulticolorPattern.NO_PATTERN;
            }
        }
Esempio n. 7
0
 public void Reset()
 {
     multiColorPattern = FurMulticolorPattern.NO_PATTERN;
     primaryColor      = HairFurColors.NO_HAIR_FUR;
     alternateColor    = HairFurColors.NO_HAIR_FUR;
 }
Esempio n. 8
0
 public bool IsIdenticalTo(HairFurColors hairColor)
 {
     return((isEmpty && hairColor?.isEmpty == true) || (!isMultiColored && hairColor == primaryColor));
 }
Esempio n. 9
0
 public static bool IsNullOrEmpty(HairFurColors color)
 {
     return(color == null || color == NO_HAIR_FUR);
 }