コード例 #1
0
        public void AddFish(string name, SpeciesEnum specie, int age) // adding the fish by the console
        {
            Type type    = Type.GetType("Csharquarium.Models.Species." + specie.ToString());
            Fish newFish = (Fish)Activator.CreateInstance(type, name, age);

            AddToArray(newFish);
        }
コード例 #2
0
        public void AddFish(string name, Genders gender) // add fishes to the aquarium
        {
            SpeciesEnum randomSpecie = (SpeciesEnum)RNG.Next(0, Enum.GetNames(typeof(SpeciesEnum)).Length);
            Type        type         = Type.GetType("Csharquarium.Models.Species." + randomSpecie.ToString());
            Fish        newFish      = (Fish)Activator.CreateInstance(type, name, gender);

            AddToArray(newFish);
        }
コード例 #3
0
        public Species(SpeciesEnum _enum, string _name, List <GenreEnum> _availableGenres)
        {
            this._enum            = _enum;
            this._name            = (_name == null || _name == "" || _enum != SpeciesEnum.CUSTOM) ? EnumConverter.Convert(_enum) : _name;
            this._availableGenres = (_availableGenres == null || _availableGenres.Count == 0) ? new List <GenreEnum>(PAPIApplication.GetAllGenres()) : _availableGenres;

            WfLogger.Log(this, LogLevel.DETAILED, "Created new Species " + this._enum);
        }
コード例 #4
0
        // --------------------------------------------------------------------------------------------------------------------------------

        /// <summary>
        /// The average appearance of the given species
        /// </summary>
        /// <param name="species">The name of the species for which the aaverage appearance is requested</param>
        /// <returns>appearcane of an average individuum of the given species</returns>
        public static CharacterAppearance GetAverageAppearance(SpeciesEnum species)
        {
            switch (species)
            {
            case SpeciesEnum.HUMAN: return(new CharacterAppearance());

            case SpeciesEnum.GHOUL: return(new CharacterAppearance(BodyHeightEnum.AVERAGE, BodyTypeEnum.AVERAGE, null,                                                                     // body type
                                                                   new Skin(SkinColorTypeEnum.SINGLE_COLOR, SkinTypeEnum.SKIN, ColorEnum.MEDIUM_FLESH, ColorEnum.NONE, "scarred, burnt"),  // skin
                                                                   new Hair(HairStyleEnum.BALD, HairLengthEnum.NONE, ColorEnum.NONE, null),                                                // hair
                                                                   ColorEnum.GREY, "bloodshot",                                                                                            // eyes
                                                                   50, null, null));                                                                                                       // age and general appearance

            case SpeciesEnum.ANDROID: return(new CharacterAppearance(BodyHeightEnum.AVERAGE, BodyTypeEnum.AVERAGE, null,                                                                   // body type
                                                                     new Skin(SkinColorTypeEnum.SINGLE_COLOR, SkinTypeEnum.ARTIFICIAL_SKIN, ColorEnum.MEDIUM_FLESH, ColorEnum.NONE, null), // skin
                                                                     new Hair(),                                                                                                           // hair
                                                                     ColorEnum.GREY, null,                                                                                                 // eyes
                                                                     30, null, null));

            case SpeciesEnum.MAGE: return(new CharacterAppearance());

            case SpeciesEnum.CATFOLK: return(new CharacterAppearance(BodyHeightEnum.AVERAGE, BodyTypeEnum.AVERAGE, null,                                                              // body type
                                                                     new Skin(SkinColorTypeEnum.HARD_SOFT_DIFFERENCE, SkinTypeEnum.FUR, ColorEnum.GREY, ColorEnum.LIGHT_GREY,
                                                                              "striped in the back, single colored chest, soft and warm fur"),                                        // skin
                                                                     new Hair(HairStyleEnum.BRAIDED, HairLengthEnum.MEDIUM, ColorEnum.DARK_GREY, "traditionally braided with beads"), // hair
                                                                     ColorEnum.AMBER, "vertical pupils, widen to the side",                                                           // eyes
                                                                     25, new Dictionary <BodyPartEnum, AppearanceFeatureEnum>()
                {
                    { BodyPartEnum.TAIL, AppearanceFeatureEnum.NOTHING_SPECIAL }
                }, null));                                                                                                                                                      // age an general appearance

            case SpeciesEnum.LIZARDFOLK: return(new CharacterAppearance(BodyHeightEnum.AVERAGE, BodyTypeEnum.AVERAGE, null,                                                     // body type
                                                                        new Skin(SkinColorTypeEnum.HARD_SOFT_DIFFERENCE, SkinTypeEnum.SCALES, ColorEnum.DARK_OLIVE, ColorEnum.OLIVE,
                                                                                 "sturdy scales on the back and skin-like, softer scales on the chest and softer parts"),       // skin
                                                                        new Hair(HairStyleEnum.BALD, HairLengthEnum.NONE, ColorEnum.OLIVE, "horn-like scales instead of hair"), // hair
                                                                        ColorEnum.OLIVE, "vertical pupils, widen to the sides",                                                 // eyes
                                                                        25, new Dictionary <BodyPartEnum, AppearanceFeatureEnum>()
                {
                    { BodyPartEnum.TAIL, AppearanceFeatureEnum.NOTHING_SPECIAL }
                }, null));                                                                                                                                                   // age and general appearance

            case SpeciesEnum.ROBOT: return(new CharacterAppearance(BodyHeightEnum.AVERAGE, BodyTypeEnum.AVERAGE, null,                                                       // body type
                                                                   new Skin(SkinColorTypeEnum.SINGLE_COLOR, SkinTypeEnum.METAL, ColorEnum.STEEL_GREY, ColorEnum.NONE, null), // skin
                                                                   new Hair(HairStyleEnum.BALD, HairLengthEnum.NONE, ColorEnum.NONE, null),                                  // hair
                                                                   ColorEnum.BLACK, null,                                                                                    // eyes
                                                                   50, null, "robotic"));

            case SpeciesEnum.SUPER_MUTANT: return(new CharacterAppearance(BodyHeightEnum.AVERAGE, BodyTypeEnum.AVERAGE, "very big and bulky",     // body type
                                                                          new Skin(SkinColorTypeEnum.SINGLE_COLOR, SkinTypeEnum.SKIN, ColorEnum.GREY, ColorEnum.NONE, null),
                                                                          new Hair(),
                                                                          ColorEnum.GREEN, null,
                                                                          50, null, null));

            default: return(new CharacterAppearance());
            }

            // ----------------------------------------------------------------------------------------------------------------------------
        }
コード例 #5
0
 public Player(int id, string pseudo, string color)
 {
     this.id        = id;
     this.pseudo    = pseudo;
     this.specie    = SpeciesEnum.NO_SPECIE;
     this.color     = ColorEnumHelper.ToEnum(color);
     this.fleets    = new List <Fleet> ();
     this.planets   = new List <Planet> ();
     this.resources = new Dictionary <ResourcesEnum, int> ();
 }
コード例 #6
0
 // --------------------------------------------------------------------------------------------------------------------------------
 /// <param name="speciesName">Enum of the required species, if it is available for the current genre, if there are more of the same enum, the first one is returned</param>
 /// <returns>The species with the given name</returns>
 public static Species GetSpecies(SpeciesEnum speciesEnum)
 {
     foreach (Species species in _allSpecies)
     {
         if (species._enum == speciesEnum && species.AvailableForGenre(PAPIApplication._runningGame._genre))
         {
             return(species);
         }
     }
     return(null);
 }
コード例 #7
0
        public Player(JObject node)
        {
            this.id      = (int)node["id"];
            this.pseudo  = (string)node["pseudo"];
            this.specie  = (SpeciesEnum)((int)node["specie"]);
            this.color   = (ColorEnum)((int)node["color"]);
            this.fleets  = new List <Fleet> ();
            this.planets = new List <Planet> ();

            this.resources = new Dictionary <ResourcesEnum, int> ();
            JArray nodeResources = (JArray)node ["resources"];

            this.resources[ResourcesEnum.RED_CRYSTAL_KYBER]    = (int)nodeResources[0];
            this.resources[ResourcesEnum.GREEN_CRYSTAL_KYBER]  = (int)nodeResources[1];
            this.resources[ResourcesEnum.BLUE_CRYSTAL_KYBER]   = (int)nodeResources[2];
            this.resources[ResourcesEnum.VIOLET_CRYSTAL_KYBER] = (int)nodeResources[3];
        }
コード例 #8
0
        public static int ToInt(SpeciesEnum specie)
        {
            switch (specie)
            {
            case SpeciesEnum.GUNGANS:
                return(0);

            case SpeciesEnum.JAWAS:
                return(1);

            case SpeciesEnum.WOOKIES:
                return(2);

            case SpeciesEnum.EWOKS:
                return(3);

            default:
                return(-1);
            }
        }
コード例 #9
0
        public static string ToExplicitString(SpeciesEnum specie)
        {
            switch (specie)
            {
            case SpeciesEnum.WOOKIES:
                return("Wookies");

            case SpeciesEnum.JAWAS:
                return("Jawas");

            case SpeciesEnum.GUNGANS:
                return("Gungans");

            case SpeciesEnum.EWOKS:
                return("Ewoks");

            default:
                return("NO_SPECIE");
            }
        }
コード例 #10
0
        // --------------------------------------------------------------------------------------------------------------------------------

        /// <summary>
        /// The initial health threshold for the given species
        /// </summary>
        /// <param name="species">The name of the species for which the initial health threshold is needed</param>
        /// <returns>the initial health threshold of the given species</returns>
        public static ThresholdValue GetInitialHealth(SpeciesEnum species)
        {
            switch (species)
            {
            case SpeciesEnum.HUMAN: return(new ThresholdValue(10, 0, null));

            case SpeciesEnum.GHOUL: return(new ThresholdValue(11, 0, null));

            case SpeciesEnum.ANDROID: return(new ThresholdValue(11, 0, null));

            case SpeciesEnum.MAGE: return(new ThresholdValue(10, 0, null));

            case SpeciesEnum.CATFOLK: return(new ThresholdValue(10, 0, null));

            case SpeciesEnum.LIZARDFOLK: return(new ThresholdValue(10, 0, null));

            case SpeciesEnum.ROBOT: return(new ThresholdValue(10, 0, null));

            case SpeciesEnum.SUPER_MUTANT: return(new ThresholdValue(13, 0, null));

            default: return(new ThresholdValue(10, 0, null));
            }
        }
コード例 #11
0
ファイル: Game.cs プロジェクト: phamthuyngan/Csharquarium
 public void AddFish(string name, SpeciesEnum specie, int age)
 {
     scene.AddFish(name, specie, age);
 }