Пример #1
0
        public GameObject loadSkeleton(GenderType gender, RigType rig)
        {
            var prefab = Resources.Load("Animation/" + gender.ToString() + "/" + rig.ToString() + "/skeleton");
            var clone  = GameObject.Instantiate(prefab);

            return(clone as GameObject);
        }
Пример #2
0
        /// <summary>
        /// Получить уточненные данные одежды
        /// </summary>
        public async Task <IResultCollection <IClothesDetailDomain> > GetClothesDetails(GenderType genderType, string clothesType) =>
        await new List <string>
        {
            genderType.ToString(), clothesType
        }

        .
        Map(parameters => RestRequest.GetRequest(ControllerName, ClothesRoutes.DETAIL_ROUTE, parameters)).
        MapAsync(request => RestHttpClient.GetCollectionAsync <ClothesDetailTransfer>(request)).
        ResultCollectionBindOkTaskAsync(transfers => _clothesDetailTransferConverter.FromTransfers(transfers));
Пример #3
0
        public override string ToString()
        {
            string strOut = string.Format("{0,-20}{1,10}\n{2,-20}{3,10}\n{4,-20}{5,10}\n",
                                          "ID:", id, "Name:", name, "Age:", age);

            strOut += string.Format("{0,-20}{1,10}\n{2,-20}{3,10}\n",
                                    "Gender:", gender.ToString(), "Category:", category.ToString());

            return(strOut);
        }
        public void Given_Instance_EnumValue_ShouldBe_Serialised_AsString(GenderType genderType)
        {
            var pet = this._fixture.Build <Person>()
                      .With(p => p.GenderType, genderType)
                      .Without(p => p.Pets)
                      .Create();

            var serialised = JsonConvert.SerializeObject(pet, this._settings);

            serialised.Should().ContainEquivalentOf(genderType.ToString());
            serialised.Should().NotContainEquivalentOf("genderType");
            serialised.Should().ContainEquivalentOf("\"gender\":");
            serialised.Should().ContainEquivalentOf("\"pets\": []");
        }
Пример #5
0
        public List <Pet> GetPetsByOwnerGender(PetType petType, GenderType gender)
        {
            List <Pet> pets = new List <Pet>();

            var people = this._peopleConnector.GetPeople();

            _log.Debug($"{people.Count} people returned from server");

            pets = people.Where(x => x.Gender == gender && x.Pets != null)
                   .SelectMany(x => x.Pets)
                   .Where(x => x.Type == petType)
                   .OrderBy(x => x.Name)
                   .ToList();

            _log.Debug($"Total pets as {petType.ToString()} for {gender.ToString()} owners are {pets.Count}");
            return(pets);
        }
Пример #6
0
        public void LoadClips(GameObject skeleton, ZMD zmd, GenderType gender, RigType rig, Dictionary <String, String> zmoPaths)
        {
            List <AnimationClip> clips = new List <AnimationClip>();

            foreach (KeyValuePair <String, String> motion in zmoPaths)
            {
                string unityPath = "Assets/Resources/Animation/" + gender.ToString() + "/" + rig.ToString() + "/clips/" + motion.Key + ".anim";

                AnimationClip clip = new ZMO("Assets/" + motion.Value).buildAnimationClip(zmd);
                clip.name   = motion.Key;
                clip.legacy = true;
                clip        = (AnimationClip)Utils.SaveReloadAsset(clip, unityPath, ".anim");
                clips.Add(clip);
            }

            Animation animation = skeleton.AddComponent <Animation>();

            AnimationUtility.SetAnimationClips(animation, clips.ToArray());
        }
Пример #7
0
        /// <summary>
        /// Loads all animations for given weapon type and gender. The clips are saved to Animation/{gender}/{weapon}/clips/{action}.anim
        /// Used only in editor to generate prefabs
        /// </summary>
        /// <param name="skeleton"></param>
        /// <param name="weapon"></param>
        /// <param name="gender"></param>
        /// <returns></returns>
        public void LoadClips(GameObject skeleton, ZMD zmd, WeaponType weapon, GenderType gender)
        {
            List <AnimationClip> clips = new List <AnimationClip>();

            foreach (ActionType action in Enum.GetValues(typeof(ActionType)))
            {
                string zmoPath   = Utils.FixPath(ResourceManager.Instance.GetZMOPath(weapon, action, gender)); // Assets/3ddata path
                string unityPath = "Assets/Resources/Animation/" + gender.ToString() + "/" + weapon.ToString() + "/clips/" + action.ToString() + ".anim";

                AnimationClip clip = new ZMO("Assets/" + zmoPath).buildAnimationClip(zmd);
                clip.name   = action.ToString();
                clip.legacy = true;
                clip        = (AnimationClip)Utils.SaveReloadAsset(clip, unityPath, ".anim");
                clips.Add(clip);
            }

            Animation animation = skeleton.AddComponent <Animation> ();

            AnimationUtility.SetAnimationClips(animation, clips.ToArray());
        }
Пример #8
0
        public void GenerateAnimationAsset(GenderType gender, RigType rig, Dictionary <String, String> zmoPaths)
        {
            GameObject skeleton = new GameObject("skeleton");
            bool       male     = (gender == GenderType.MALE);
            ZMD        zmd      = new ZMD(male ? "Assets/3DData/Avatar/MALE.ZMD" : "Assets/3DData/Avatar/FEMALE.ZMD");

            zmd.buildSkeleton(skeleton);

            BindPoses poses = ScriptableObject.CreateInstance <BindPoses>();

            poses.bindPoses      = zmd.bindposes;
            poses.boneNames      = getBoneNames(zmd.boneTransforms);
            poses.boneTransforms = zmd.boneTransforms;
            LoadClips(skeleton, zmd, gender, rig, zmoPaths);
            string path = "Assets/Resources/Animation/" + gender.ToString() + "/" + rig.ToString() + "/skeleton.prefab";

            AssetDatabase.CreateAsset(poses, path.Replace("skeleton.prefab", "bindPoses.asset"));
            AssetDatabase.SaveAssets();
            PrefabUtility.CreatePrefab(path, skeleton);
        }
Пример #9
0
            internal static string GetSlotPicture(SlotType?slot, RaceType race, GenderType gender, byte augLevel)
            {
                string result = "Resources\\Bodies\\" + race.ToString() + "\\" + gender.ToString() + "\\" + slot.ToString();

                switch (augLevel)
                {
                case 0: break;

                case 1:
                {
                    result += "_Mod";
                    break;
                }

                case 2:
                default:
                {
                    result += "_Aug";
                    break;
                }
                }
                return(result += ".png");
            }
Пример #10
0
 protected string CheckGenderType(GenderType gt)
 {
     return(gt.ToString());
 }
Пример #11
0
        /// <summary>
        /// Load bindposes and bones matrices from resources scriptable object
        /// </summary>
        /// <param name="gender"></param>
        /// <param name="weapon"></param>
        /// <returns></returns>
        public BindPoses loadBindPoses(GameObject skeleton, GenderType gender, WeaponType weapon)
        {
            BindPoses poses = ScriptableObject.Instantiate <BindPoses>((BindPoses)Resources.Load("Animation/" + gender.ToString() + "/" + weapon.ToString() + "/bindPoses"));

            for (int i = 0; i < poses.boneNames.Length; i++)
            {
                poses.boneTransforms[i] = Utils.findChild(skeleton, poses.boneNames[i]);
            }
            return(poses);
        }
Пример #12
0
        public void LoadClips(GameObject skeleton, ZMD zmd, GenderType gender, RigType rig, Dictionary<String, String> zmoPaths)
        {
            List<AnimationClip> clips = new List<AnimationClip>();

            foreach (KeyValuePair<String, String> motion in zmoPaths)
            {
                string unityPath = "Assets/Resources/Animation/" + gender.ToString() + "/" + rig.ToString() + "/clips/" + motion.Key + ".anim";

                AnimationClip clip = new ZMO("Assets/" + motion.Value).buildAnimationClip(zmd);
                clip.name = motion.Key;
                clip.legacy = true;
                clip = (AnimationClip)Utils.SaveReloadAsset(clip, unityPath, ".anim");
                clips.Add(clip);
            }

            Animation animation = skeleton.AddComponent<Animation>();
            AnimationUtility.SetAnimationClips(animation, clips.ToArray());
        }
Пример #13
0
        public void GenerateAnimationAsset(GenderType gender, RigType rig, Dictionary<String,String> zmoPaths)
        {
            GameObject skeleton = new GameObject("skeleton");
            bool male = (gender == GenderType.MALE);
            ZMD zmd = new ZMD(male ? "Assets/3DData/Avatar/MALE.ZMD" : "Assets/3DData/Avatar/FEMALE.ZMD");
            zmd.buildSkeleton(skeleton);

            BindPoses poses = ScriptableObject.CreateInstance<BindPoses>();
            poses.bindPoses = zmd.bindposes;
            poses.boneNames = getBoneNames(zmd.boneTransforms);
            poses.boneTransforms = zmd.boneTransforms;
            LoadClips(skeleton, zmd, gender, rig, zmoPaths);
            string path = "Assets/Resources/Animation/" + gender.ToString() + "/" + rig.ToString() + "/skeleton.prefab";
            AssetDatabase.CreateAsset(poses, path.Replace("skeleton.prefab", "bindPoses.asset"));
            AssetDatabase.SaveAssets();
            PrefabUtility.CreatePrefab(path, skeleton);
        }
Пример #14
0
        /// <summary>
        /// Loads all animations for given weapon type and gender. The clips are saved to Animation/{gender}/{weapon}/clips/{action}.anim 
        /// Used only in editor to generate prefabs
        /// </summary>
        /// <param name="skeleton"></param>
        /// <param name="weapon"></param>
        /// <param name="gender"></param>
        /// <returns></returns>
        public void LoadClips(GameObject skeleton, ZMD zmd, WeaponType weapon, GenderType gender)
        {
            List<AnimationClip> clips = new List<AnimationClip>();

            foreach (ActionType action in Enum.GetValues(typeof(ActionType)))
            {
                string zmoPath = Utils.FixPath(ResourceManager.Instance.GetZMOPath(weapon, action, gender));  // Assets/3ddata path
                string unityPath = "Assets/Resources/Animation/" + gender.ToString() + "/" + weapon.ToString() + "/clips/" + action.ToString() + ".anim";

                AnimationClip clip =  new ZMO("Assets/" + zmoPath).buildAnimationClip(zmd);
                clip.name = action.ToString();
                clip.legacy = true;
                clip = (AnimationClip)Utils.SaveReloadAsset(clip, unityPath, ".anim");
                clips.Add(clip);
            }

            Animation animation = skeleton.AddComponent<Animation> ();
            AnimationUtility.SetAnimationClips(animation, clips.ToArray());
        }
Пример #15
0
        public async Task <SaltyCommandResult> ChangeGenderAsync(
            [Description("Gender you want to change to")]
            GenderType newGender,
            [Description("Character you want to change the gender")]
            IPlayerEntity player = null)
        {
            if (player == null)
            {
                player = Context.Player;
            }

            await player.ChangeGender(newGender);

            return(new SaltyCommandResult(true, $"{player.Character.Name}'s gender has been changed to {newGender.ToString()}."));
        }
Пример #16
0
 public GameObject loadSkeleton(GenderType gender, RigType rig)
 {
     var prefab = Resources.Load("Animation/" + gender.ToString() + "/" + rig.ToString() + "/skeleton");
     var clone = GameObject.Instantiate(prefab);
     return clone as GameObject;
 }
Пример #17
0
 public override string ToString()
 {
     return($"{FirstName} {LastName} ({Gender.ToString().Substring(0, 1)})");
 }
Пример #18
0
 public static string ConvertGenderTypeToString(GenderType t)
 {
     return(t.ToString());
 }
Пример #19
0
        public IActionResult GetByGender(GenderType gender)
        {
            IEnumerable <Person> passengers = repository.GetAll().Where(p => p.Gender == gender);

            if (passengers.Count() == 0)
            {
                return(NotFound(ResponseObject.StatusCode(MessageCode.ERROR_VALUE_NOT_FOUND, string.Format("No passengers found for gender: {0}", gender.ToString()))));
            }

            return(Ok(ResponseObject.Ok(passengers)));
        }
Пример #20
0
 protected void AddGender(StringBuilder stringBuilder, GenderType genderType)
 {
     stringBuilder.AppendLine($"GENDER:{genderType.ToString()}");
 }
Пример #21
0
        public static WordDocument AddStudentInfo(this WordDocument source, string name, string id, string dob, GenderType gender, string grade, string campus, SchoolYearType schoolYear, string teacherName, string gradingPeriod)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }

            if (dob == null)
            {
                throw new ArgumentNullException(nameof(dob));
            }

            if (grade == null)
            {
                throw new ArgumentNullException(nameof(grade));
            }

            if (campus == null)
            {
                throw new ArgumentNullException(nameof(campus));
            }

            if (teacherName == null)
            {
                throw new ArgumentNullException(nameof(teacherName));
            }

            if (gradingPeriod == null)
            {
                throw new ArgumentNullException(nameof(gradingPeriod));
            }

            DateTime zeroTime = new DateTime(1, 1, 1);
            var      age      = DateTime.Now - DateTime.Parse(dob);
            int      years    = (zeroTime + age).Year - 1;

            string school_year;

            switch (schoolYear)
            {
            case SchoolYearType._2019_2020:
                school_year = "2019-2020";
                break;

            default:
                school_year = "2020-2021";
                break;
            }

            return(source.AddParagraph(WordFactory.Paragraph(
                                           HorizontalAlignmentType.Left,
                                           WordFactory.Text("Name: "),
                                           WordFactory.UnderlineText(name).AppendTab(),
                                           WordFactory.Text("\t DOB: "),
                                           WordFactory.UnderlineText(dob).AppendTab(),
                                           WordFactory.Text("\t ID#: "),
                                           WordFactory.UnderlineText(id).AppendTab(),
                                           WordFactory.Text("\t Age: "),
                                           WordFactory.UnderlineText(years.ToString()).AppendTab(),
                                           WordFactory.Text("\t Gender: "),
                                           WordFactory.UnderlineText(gender.ToString()).AppendTab(),
                                           WordFactory.Text("\t Grade: "),
                                           WordFactory.UnderlineText(grade).AppendTab().AppendCarriageReturn().AppendCarriageReturn(),
                                           WordFactory.Text("School Year: "),
                                           WordFactory.UnderlineText(school_year).AppendTab(),
                                           WordFactory.Text("\t Campus: "),
                                           WordFactory.UnderlineText(campus).AppendTab(),
                                           WordFactory.Text("\t Reviewer: "),
                                           WordFactory.UnderlineText(teacherName).AppendTab().AppendCarriageReturn().AppendCarriageReturn(),
                                           WordFactory.Text("Grading Period: "),
                                           WordFactory.UnderlineText(gradingPeriod).AppendTab(),
                                           WordFactory.Text("\t Documentation Date: "),
                                           WordFactory.UnderlineText("                   ").AppendTab(),
                                           WordFactory.Text("\t Goal Result: "),
                                           WordFactory.UnderlineText("                   ").AppendTab().AppendCarriageReturn()
                                           )));
        }
Пример #22
0
 /// <summary>
 /// Load bindposes and bones matrices from resources scriptable object
 /// </summary>
 /// <param name="gender"></param>
 /// <param name="weapon"></param>
 /// <returns></returns>
 public BindPoses loadBindPoses(GameObject skeleton, GenderType gender, WeaponType weapon)
 {
     BindPoses poses =  ScriptableObject.Instantiate<BindPoses>((BindPoses)Resources.Load ("Animation/" + gender.ToString () + "/" + weapon.ToString () + "/bindPoses"));
     for (int i = 0; i < poses.boneNames.Length; i++) {
         poses.boneTransforms[i] = Utils.findChild(skeleton, poses.boneNames[i]);
     }
     return poses;
 }
Пример #23
0
        public IEnumerable <Person> GetPeopleByGender(GenderType gender)
        {
            var passengers = GetAll().Where(p => p.Gender == gender).ToArray();

            if (passengers.Any())
            {
                return(passengers);
            }

            throw new ElementNotFoundException($"There were no passengers of gender: {gender.ToString()} found");
        }