예제 #1
0
        protected GillType(ShortPluralDescriptor shortDesc, SimpleDescriptor singleDesc, PartDescriptor <GillData> longDesc, PlayerBodyPartDelegate <Gills> playerDesc,
                           ChangeType <GillData> transform, RestoreType <GillData> restore) : base(PluralHelper(shortDesc), singleDesc, longDesc, playerDesc, transform, restore)
        {
            _index = indexMaker++;
            gills.AddAt(this, _index);

            pluralDesc = shortDesc;
        }
예제 #2
0
        protected static SimpleDescriptor PluralHelper(ShortPluralDescriptor shortDescWithPluralFlag, bool defaultsToPlural = true)
        {
            if (shortDescWithPluralFlag is null)
            {
                throw new ArgumentNullException(nameof(shortDescWithPluralFlag));
            }

            return(() => shortDescWithPluralFlag(defaultsToPlural));
        }
예제 #3
0
        //C# 7.2 magic. basically, prevents it from being messed with except internally.
        private AntennaeType(ShortPluralDescriptor desc, SimpleDescriptor singleItemDesc, PluralPartDescriptor <AntennaeData> longDesc,
                             PlayerBodyPartDelegate <Antennae> playerDesc, ChangeType <AntennaeData> transformMessage, RestoreType <AntennaeData> revertToDefault)
            : base(PluralHelper(desc), singleItemDesc, LongPluralHelper(longDesc), playerDesc, transformMessage, revertToDefault)
        {
            shortPluralDesc = desc ?? throw new ArgumentNullException(nameof(desc));
            longPluralDesc  = longDesc ?? throw new ArgumentNullException(nameof(longDesc));

            _index = indexMaker++;
            antennaes.AddAt(this, _index);
        }
예제 #4
0
        private protected HandType(HandStyle style, ShortPluralDescriptor nounText, ShortPluralDescriptor nailsText, ShortPluralDescriptor shortDesc, SimpleDescriptor singleDesc,
                                   PluralPartDescriptor <HandData> longDesc) : base(PluralHelper(shortDesc), singleDesc)
        {
            _index          = indexMaker++;
            longDescription = longDesc ?? throw new ArgumentNullException(nameof(longDesc));
            handStr         = nounText ?? throw new ArgumentNullException(nameof(nounText));
            shortPluralDesc = shortDesc;

            nailsStr  = nailsText;
            handStyle = style;
        }
예제 #5
0
        protected EarType(bool internalEar, ShortPluralDescriptor shortDesc, SimpleDescriptor singleItemDesc, PluralPartDescriptor <EarData> longDesc,
                          PlayerBodyPartDelegate <Ears> playerDesc, ChangeType <EarData> transform, RestoreType <EarData> restore)
            : base(PluralHelper(shortDesc), singleItemDesc, LongPluralHelper(longDesc), playerDesc, transform, restore)
        {
            shortPluralDesc = shortDesc;
            longPluralDesc  = longDesc;

            _index = indexMaker++;
            ears.AddAt(this, id);

            isInternalEar = internalEar;
        }
예제 #6
0
        //i should use maybe plural desriptor here by naming conventions, but in this case i know exactly when it's plural, so i can fake it with the function that
        //exposes the delegate. probably should do it anyway, but it's easier to implement like this.
        private protected EyeType(EyeColor defaultEyeColor, EyeChangeDelegate eyeChange,
                                  ShortPluralDescriptor shortDesc, SimpleDescriptor singleItemDesc, PartDescriptor <EyeData> longDesc, SingleEyeDescriptor oneEyeDesc, PartDescriptor <EyeData> fullDesc,
                                  PlayerBodyPartDelegate <Eyes> playerDesc, ChangeType <EyeData> transform, RestoreType <EyeData> restore, byte numEyes = 2, ScleraColor color = ScleraColor.CLEAR)
            : base(PluralHelper(shortDesc), singleItemDesc, longDesc, playerDesc, transform, restore)
        {
            EyeChangeSpecial = eyeChange;
            eyeCount         = numEyes;
            defaultColor     = defaultEyeColor;
            _index           = indexMaker++;

            eyeDesc         = shortDesc;
            eyeFullDesc     = fullDesc ?? throw new ArgumentNullException(nameof(fullDesc));
            this.oneEyeDesc = oneEyeDesc ?? throw new ArgumentNullException(nameof(oneEyeDesc));

            eyes.AddAt(this, _index);
            scleraColor = color;
        }
예제 #7
0
        private protected WingType(bool canFly,
                                   ShortPluralDescriptor shortDesc, SimpleDescriptor singleWingDesc, PluralPartDescriptor <WingData> longDesc, PlayerBodyPartDelegate <Wings> playerDesc,
                                   ChangeType <WingData> transform, RestoreType <WingData> restore) : base(PluralHelper(shortDesc), singleWingDesc, LongPluralHelper(longDesc), playerDesc, transform, restore)
        {
            _index = indexMaker++;
            wings.AddAt(this, _index);
            transformBehavior = canFly ? BehaviorOnTransform.CONVERT_TO_LARGE : BehaviorOnTransform.CONVERT_TO_SMALL;             //was wrong, caught in testing.

            wingShortDesc = (_, plural) => shortDesc(plural);

            wingSingleDesc = (_) => singleWingDesc();

            longPluralDesc = longDesc;

            canChangeSize = false;

            changeSizeStr = (x, y) => "";
        }
예제 #8
0
 internal FeatheredWings(HairFurColors defaultHair, bool canFly, ShortPluralDescriptor shortDesc, SimpleDescriptor singleWingDesc, PluralPartDescriptor <WingData> longDesc,
                         PlayerBodyPartDelegate <Wings> playerDesc, ChangeType <WingData> transform, RestoreType <WingData> restore)
     : base(canFly, shortDesc, singleWingDesc, longDesc, playerDesc, transform, restore)
 {
     defaultFeatherColor = defaultHair;
 }
예제 #9
0
 public StoneStareEyeType(EyeColor defaultEyeColor, EyeChangeDelegate eyeChange, ShortPluralDescriptor shortDesc, SimpleDescriptor singleItemDesc,
                          PartDescriptor <EyeData> longDesc, SingleEyeDescriptor oneEyeDesc, PartDescriptor <EyeData> fullDesc, PlayerBodyPartDelegate <Eyes> playerDesc,
                          ChangeType <EyeData> transform, RestoreType <EyeData> restore, byte numEyes = 2, ScleraColor color = ScleraColor.CLEAR)
     : base(defaultEyeColor, eyeChange, shortDesc, singleItemDesc, longDesc, oneEyeDesc, fullDesc, playerDesc, transform, restore, numEyes, color)
 {
 }