コード例 #1
0
 /// <summary>
 ///Creates a reproduction with initial state.
 /// </summary>
 /// <param name="female">The female.</param>
 /// <param name="male">The male.</param>
 /// <param name="date">The date.</param>
 /// <param name="type">The type.</param>
 /// <param name="status">The status.</param>
 /// <param name="commentary">The commentary.</param>
 /// <returns></returns>
 public static Reproduction Initialize(Female female, Male male, DateTime date,
                                       ReproductionTypeEnum type, ReproductionStateEnum status,
                                       string commentary)
 {
     if (female != null && female.CanBeMated(date) && status == ReproductionStateEnum.Initial)
     {
         return(new Reproduction(female, male, date, type, ReproductionStateEnum.Initial, commentary));
     }
     return(Reproduction.None);
 }
コード例 #2
0
            public static void ChaControl_InitializePostHook(Male __instance)
            {
                KoikatuAPI.Logger.LogDebug($"Character card load: {__instance.MaleID}");

                ChaControls.Add(__instance);

                if (!MakerAPI.CharaListIsLoading)
                {
                    CreateOrAddBehaviours(__instance);
                }
            }
コード例 #3
0
ファイル: TDBaseName.cs プロジェクト: chengyimingvb/CYMUni
 public override void OnBeAddedToData()
 {
     base.OnBeAddedToData();
     LastNameKeys.Clear();
     LastNameKeys = BaseLanguageMgr.GetCategory(Last);
     All.Clear();
     All.AddRange(Male.NameKeys);
     All.AddRange(Female.NameKeys);
     All.AddRange(LastNameKeys);
     Male.Parse();
     Female.Parse();
 }
コード例 #4
0
        private async void Male_Tapped(object sender, EventArgs e)
        {
            Female.BackgroundColor = Color.FromHex("#1D212C");
            Female.Border.Color    = Color.FromHex("#33394a");
            Trans.BackgroundColor  = Color.FromHex("#1D212C");
            Trans.Border.Color     = Color.FromHex("#33394a");
            await Male.ScaleTo(0.85);

            Male.BackgroundColor = Color.FromHex("#6d54f8");
            Male.Border.Color    = Color.FromHex("#6d54f8");
            await Male.ScaleTo(1);
        }
コード例 #5
0
    public Female(string name, Female mother, Male father)
    {
        if (!first && (mother is null || father is null))
        {
            throw new ArgumentNullException();
        }

        this.Father = father;
        this.Mother = mother;
        this.Name   = name;
        first       = false;
    }
コード例 #6
0
 void Awake()
 {
     //For now, hard code the character's gender. This will be changed when a charcter select screen is added.
     gender = new Male(this);
     cachedSpriteRenderer = GetComponent <SpriteRenderer>();
     //Set the sprite to be either male or female
     setCharacterSprite();
     //Get a reference to the Singleton GameManager
     gameManager = GameManager.Instance;
     //Set the player reference in the GameManager class
     gameManager.setPlayer(this);
 }
コード例 #7
0
        public override void WriteBinary(ESPWriter writer)
        {
            Marker.WriteBinary(writer);

            if (Male != null)
            {
                Male.WriteBinary(writer);
            }
            if (Female != null)
            {
                Female.WriteBinary(writer);
            }
        }
コード例 #8
0
ファイル: OldDataConverter.cs プロジェクト: zo845845/ABMX
 private static string GetCharacterName(this Human h)
 {
     if (StudioAPI.InsideStudio)
     {
         var charaName = Studio.Studio.Instance.dicObjectCtrl.Values.OfType <OCIChar>().FirstOrDefault(x => x.charInfo.human == h)?.charStatus.name;
         if (!string.IsNullOrEmpty(charaName))
         {
             return(charaName);
         }
     }
     return(h is Female f
         ? Female.HeroineName(f.HeroineID)
         : Male.MaleName(((Male)h).MaleID));
 }
コード例 #9
0
        private void onBMIChanged()
        {
            if (String.IsNullOrEmpty(this.tbHeight.Text))
            {
                return;
            }
            decimal totalWeight;

            if (!Decimal.TryParse(this.tbTotalWeight.Text, out totalWeight))
            {
                return;
            }
            decimal height;

            if (!Decimal.TryParse(this.tbHeight.Text, out height))
            {
                return;
            }
            IScale4SW scale;

            if (String.Equals(this.cbSex.SelectedItem, "男"))
            {
                scale = new Male();
            }
            else if (String.Equals(this.cbSex.SelectedItem, "女"))
            {
                scale = new Female();
            }
            else
            {
                return;
            }
            var sw = new StandardWeight(scale)
            {
                TotalWeight = totalWeight,
                Height      = height
            };

            this.tbStandardWeightPercent.Text = sw.run().ToString();
            this.tbStandardWeight.Text        = sw.StandardWight.ToString();

            var bmi = new BMI()
            {
                TotalWeight = totalWeight,
                Height      = height
            };

            this.tbBMI.Text = bmi.run().ToString();
        }
コード例 #10
0
 private void markform_Load(object sender, EventArgs e)
 {
     richTextBox1.SetInnerMargins(5, 5, 5, 0);
     verification();
     this.Height = 472;
     if (test)
     {
         Male.Select();
         textBox1.Text           = "林子揚";
         textBox2.Text           = "*****@*****.**";
         comboBox1.SelectedIndex = 1;
         textBox3.Text           = "問題回報功能測試";
         richTextBox1.Text       = "測試問題回報功能\n\nPellentesque eu dictum odio, eget euismod ipsum. Aliquam vehicula metus ut tempor pulvinar. Maecenas dignissim nulla sit amet mauris faucibus rutrum. Aenean rhoncus, enim at efficitur tincidunt, neque ante pharetra eros, sit amet commodo eros enim sed leo. Fusce quis mauris ut dolor efficitur consectetur quis et nibh. Nunc viverra.\n\n善小電程,到你不同,著上越自行事學於問試黑經,後業再化先、低空美們成不期近;的時何活我工良快致全轉國兩受城一因得教而,收把河隨的深話是人在;及弟便師物的中臺於舉?業到爸到道去生起在,腦代環洲有年情對在孩走當那立,可車護就前歡果當政作三。";
     }
 }
コード例 #11
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            Male = (RadioButton)GetTemplateChild("PART_Male");
            Male.SetBinding(RadioButton.IsCheckedProperty, new Binding {
                Source = this, Path = new PropertyPath(CurrentValueProperty), Mode = BindingMode.TwoWay
            });
            Male.Checked += Checked;
            Female        = (RadioButton)GetTemplateChild("PART_Female");
            Female.SetBinding(RadioButton.IsCheckedProperty, new Binding {
                Source = this, Path = new PropertyPath(CurrentValueProperty), Mode = BindingMode.TwoWay, Converter = new BooleanReverseValueConverter()
            });
            Female.Checked += Checked;
        }
コード例 #12
0
        public static Patient CreatePatient(string name, DateTime birthDate, Male male, byte height, byte weight, Doctor doctor)
        {
            Patient newPatient = new Patient();

            newPatient.FullName  = name;
            newPatient.BirthDate = birthDate;
            newPatient.Male      = male;
            newPatient.Height    = height;
            newPatient.Weight    = weight;

            newPatient.Login    = "******";
            newPatient.Password = "******";

            return(newPatient);
        }
コード例 #13
0
        static void Main(string[] args)
        {
            Dog           dog           = new Dog();
            Male          male          = new Male();
            Parrot        parrot        = new Parrot();
            ParrotAdapter parrotAdapter = new ParrotAdapter(parrot);

            dog.MakeSound("Bhow Bhow!");
            male.SpeakWords("Ssup dude!");
            parrot.MakeSound("Phew!");

            // parrot should not 'make sound', it should 'speak words'
            parrotAdapter.SpeakWords("Hey, parrot can speak.");

            Console.ReadLine();
        }
コード例 #14
0
ファイル: UnitTest1.cs プロジェクト: Zhunusau/Codewars
        public void Human_can_reproduce_when_they_have_a_mother_and_father_and_have_a_name()
        {
            var adam  = Adam.GetInstance();
            var eve   = Eve.GetInstance(adam);
            var seth  = new Male("Seth", eve, adam);
            var azura = new Female("Azura", eve, adam);
            var enos  = new Male("Enos", azura, seth);

            Assert.AreEqual("Eve", eve.Name);
            Assert.AreEqual("Adam", adam.Name);
            Assert.AreEqual("Seth", seth.Name);
            Assert.AreEqual("Azura", azura.Name);
            Assert.AreEqual("Enos", ((Human)enos).Name);
            Assert.AreEqual(seth, ((Human)enos).Father);
            Assert.AreEqual(azura, ((Human)enos).Mother);
        }
コード例 #15
0
        /// <summary>
        /// Converts the instance data into XML
        /// Used for transmitting across net
        /// </summary>
        public XElement ToXml()
        {
            //create root tag to hold data
            var compatibilityReport = new XElement("CompatibilityReport");

            //place data in individual tags
            var kutaScore      = new XElement("KutaScore", this.KutaScore);
            var male           = new XElement("Male", Male.ToXml());
            var female         = new XElement("Female", Female.ToXml());
            var predictionList = PredictionListToXml(this.PredictionList);

            //add in the data
            compatibilityReport.Add(kutaScore, male, female, predictionList);

            return(compatibilityReport);
        }
コード例 #16
0
            public void Humans_can_reproduce_when_there_is_a_name_a_mother_and_a_father()
            {
                Adam   adam  = Adam.GetInstance();
                Eve    eve   = Eve.GetInstance(adam);
                Male   seth  = new Male("Seth", eve, adam);
                Female azura = new Female("Azura", eve, adam);
                Male   enos  = new Male("Enos", azura, seth);

                Assert.AreEqual("Eve", eve.Name);
                Assert.AreEqual("Adam", adam.Name);
                Assert.AreEqual("Seth", seth.Name);
                Assert.AreEqual("Azura", azura.Name);
                Assert.AreEqual("Enos", ((Human)enos).Name);
                Assert.AreEqual(seth, ((Human)enos).Father);
                Assert.AreEqual(azura, ((Human)enos).Mother);
            }
コード例 #17
0
ファイル: Manger.cs プロジェクト: xAdamQ/SomeCity
    // Start is called before the first frame update
    void Start()
    {
        Plane.OneTimeIni();
        World.OneTimeIni();
        Human.OneTimeIni();
        Building.OneTimeIni();
        Mat.OneTimeIni();
        Shelter.OneTimeIni();
        Female.OneTimeIni();
        Male.OneTimeIni();
        Cam.OneTimeIni();
        FoodSourceBuilding.OneTimeIni();
        Mine.OneTimeIni();


        HumanEleUI.OneTimeIni();
    }
コード例 #18
0
        public override void WriteXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("Marker", true, out subEle);
            Marker.WriteXML(subEle, master);

            if (Male != null)
            {
                ele.TryPathTo("Male", true, out subEle);
                Male.WriteXML(subEle, master);
            }
            if (Female != null)
            {
                ele.TryPathTo("Female", true, out subEle);
                Female.WriteXML(subEle, master);
            }
        }
コード例 #19
0
        static void Main(string[] args)
        {
            var person = new Person("Chris", 1998, 55, 1.7F, Gender.Male);



            BMI.BMI.GetPersonsBMI(person);

            Male male = new Male(person, 30, 40);

            Console.WriteLine(male.Comment);

            Console.WriteLine(BMI.BMI.GetPersonsBMI(person));

            var QuestionLogic = new QuestionLogic();

            QuestionLogic.UserInput(person);
            Console.ReadKey();
        }
コード例 #20
0
    public void SetAttributes(string n, int h, int w, Constants.HairColor hc, decimal ss, int dscs, int nk, bool m)
    {
        // call gender specific set function, human does not have get and set attribute functions so the gender
        // specific versions must be called unlike the WhatAmI and Print functions
        Female f = gender as Female;

        if (f != null)
        {
            f.SetAttributes(n, h, w, hc, ss, dscs);
        }
        else
        {
            Male ma = gender as Male;
            ma.SetAttributes(n, h, w, hc, ss, dscs);
        }
        // set person specific fields
        numKids = nk;
        married = m;
    }
コード例 #21
0
    public void GetAttributes(out string n, out int h, out int w, out Constants.HairColor hc, out Constants.EyeColor ec, out decimal ss, out int dscs, out int nk, out bool m)
    {
        // call gender specific get function, human does not have get and set attribute functions so the gender
        // specific versions must be called unlike the WhatAmI and Print functions which are virtual functions in human
        Female f = gender as Female;

        if (f != null)
        {
            f.GetAttributes(out n, out h, out w, out hc, out ec, out ss, out dscs);
        }
        else
        {
            Male ma = gender as Male;
            ma.GetAttributes(out n, out h, out w, out hc, out ec, out ss, out dscs);
        }
        // get person specific fields
        nk = numKids;
        m  = married;
    }
コード例 #22
0
        private void SetPOV()
        {
            if (!lockNormalCamera)
            {
                female        = FindObjectOfType <Female>();
                male          = FindObjectOfType <Male>();
                currentTarget = male;

                if (currentTarget)
                {
                    neckBackup = currentTarget.NeckLook.CalcType;
                    currentTarget.NeckLook.Change(LookAtRotator.TYPE.NO, Camera.main.transform, true);
                    fovBackup        = Camera.main.fieldOfView;
                    lockNormalCamera = true;

                    if (female)
                    {
                        femEyeBackup = female.EyeLook.CalcType;
                        female.EyeLook.Change(LookAtRotator.TYPE.TARGET, Camera.main.transform, true);
                    }
                }
            }
            else
            {
                switch (neckRotator.mode)
                {
                case NeckMode.Both:
                    neckRotator = neckRotators[NeckMode.First];
                    break;

                case NeckMode.First:
                    neckRotator = neckRotators[NeckMode.Second];
                    break;

                case NeckMode.Second:
                    neckRotator = neckRotators[NeckMode.Both];
                    break;
                }

                RealPOV.Logger.Log(LogLevel.Message, neckRotator.mode);
            }
        }
コード例 #23
0
        private void SignUp_Click(object sender, EventArgs e)
        {
            string   name      = NewName.Text;
            DateTime birthDate = NewDateBirth.Value;
            Male     male      = NewMale.Checked ? Male.Male : Male.Female;
            byte     height    = byte.Parse(NewHeight.Text);
            byte     weight    = byte.Parse(NewWeight.Text);

            _container = new EntityModelContainer();
            Patient newPatient = InformationSystem.CreatePatient(name, birthDate, male, height, weight, user);

            InformationSystem.AddPatient(newPatient, user);

            DeviceFunction deviceType = 0;

            switch (NewDeviceType.SelectedIndex)
            {
            case 0:
                deviceType = DeviceFunction.Glucometer;
                break;

            case 1:
                deviceType = DeviceFunction.HeartRateMonitor;
                break;

            case 2:
                deviceType = DeviceFunction.BloodPressureMonitor;
                break;
            }

            Device newDevice = InformationSystem.CreateDevice(newPatient, deviceType);

            InformationSystem.AddDevice(newDevice, newPatient);

            DoctorMessage informMessage = InformationSystem.CreatePatientMessage(user, newPatient, AllowAccess.Checked);

            InformationSystem.AddDoctorMessage(informMessage);

            MessageBox.Show("Пациент успешно зарегистрирован");

            this.Close();
        }
コード例 #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Reproduction"/> class.
 /// </summary>
 /// <param name="female">The female.</param>
 /// <param name="male">The male.</param>
 /// <param name="date">The date.</param>
 /// <param name="type">The type.</param>
 /// <param name="states">The states.</param>
 /// <param name="commentary">The commentary.</param>
 private Reproduction(Female female, Male male, DateTime date, ReproductionTypeEnum type,
                      IEnumerable <ReproductionState> states, string commentary)
 {
     if (female != null && male != null)
     {
         Female     = female;
         Male       = male;
         Date       = date;
         Type       = type;
         States     = States.Union(states);
         Commentary = commentary;
     }
     else
     {
         Female = null;
         Male   = null;
         Date   = DateTime.MinValue;
         Type   = ReproductionTypeEnum.Artificial;
     }
 }
コード例 #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Reproduction"/> class.
 /// </summary>
 /// <param name="female">The female.</param>
 /// <param name="male">The male.</param>
 /// <param name="date">The date.</param>
 /// <param name="type">The type.</param>
 /// <param name="status">The status.</param>
 /// <param name="commentary">The commentary.</param>
 private Reproduction(Female female, Male male, DateTime date,
                      ReproductionTypeEnum type, ReproductionStateEnum status,
                      string commentary)
 {
     if (female != null && female.CanBeMated(date) && status == ReproductionStateEnum.Initial)
     {
         Female = female;
         Male   = male;
         Date   = date;
         Type   = type;
         States.Append(new ReproductionState(status, date));
         Commentary = commentary;
     }
     else
     {
         Female = null;
         Male   = null;
         Date   = DateTime.MinValue;
         Type   = ReproductionTypeEnum.Artificial;
     }
 }
コード例 #26
0
        private void onBFRChanged()
        {
            if (String.IsNullOrEmpty(this.tbWaistLine.Text))
            {
                return;
            }
            decimal totalWeight;

            if (!Decimal.TryParse(this.tbTotalWeight.Text, out totalWeight))
            {
                return;
            }
            decimal waistLine;

            if (!Decimal.TryParse(this.tbWaistLine.Text, out waistLine))
            {
                return;
            }
            IScale4BFR scale;

            if (String.Equals(this.cbSex.SelectedItem, "男"))
            {
                scale = new Male();
            }
            else if (String.Equals(this.cbSex.SelectedItem, "女"))
            {
                scale = new Female();
            }
            else
            {
                return;
            }
            var bfr = new BFR(scale)
            {
                TotalWeight = totalWeight,
                WaistLine   = waistLine
            };

            this.tbBFR.Text = bfr.run().ToString();
        }
コード例 #27
0
        private void SetPOV()
        {
            if (!lockNormalCamera)
            {
                female        = FindObjectOfType <Female>();
                male          = FindObjectOfType <Male>();
                currentTarget = male;

                if (currentTarget)
                {
                    neckBackup = currentTarget.NeckLook.CalcType;
                    currentTarget.NeckLook.Change(LookAtRotator.TYPE.NO, Camera.main.transform, true);
                    fovBackup        = Camera.main.fieldOfView;
                    lockNormalCamera = true;

                    if (female)
                    {
                        femEyeBackup = female.EyeLook.CalcType;
                        female.EyeLook.Change(LookAtRotator.TYPE.TARGET, Camera.main.transform, true);
                    }
                }
            }
        }
コード例 #28
0
ファイル: MockUnitTest.cs プロジェクト: Harley-Blog/XUnitDemo
        public void SavePersonToString_WithMale_ReturnTrue()
        {
            var mockRedisService = new Mock <IRedisService>();
            var male             = new Male {
                Name = "Harley"
            };

            mockRedisService.Setup(s => s.SavePersonToString(It.IsAny <It.IsSubtype <Person> >())).Returns(true);
            var result1 = mockRedisService.Object.SavePersonToString(new { Name = "Harley", JobType = "Coder" });
            var result2 = mockRedisService.Object.SavePersonToString(new Person {
                Name = "Harley"
            });
            var result3 = mockRedisService.Object.SavePersonToString(new Male {
                Name = "Harley"
            });

            Assert.Multiple(() =>
            {
                Assert.AreEqual(true, result1, "使用匿名类型生成的对象无法通过测试");
                Assert.AreEqual(true, result2, "使用Person类型生成的对象无法通过测试");
                Assert.AreEqual(true, result3, "使用Male类型生成的对象无法通过测试");
            });
        }
コード例 #29
0
ファイル: Form1.cs プロジェクト: EmmaForsberg/PersonRegistry
        /// <summary>
        /// Metod för att kontrollera att man valt en knapp för male/female och lägger till valda i listan
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Addbuttom_Click(object sender, EventArgs e)
        {
            firstname = firstnametextbox.Text;
            lastname  = lastnametextbox.Text;

            if (CheckForWrongInput() == false)
            {
                if (femalebuttom.Checked)
                {
                    Female female = new Female("Mrs", firstname, lastname);
                    personlist.Add(female);
                    string femalereturn = female.ReturnName();
                    listBoxOutPut.Items.Add(femalereturn);
                }
                else if (malebuttom.Checked)
                {
                    Male male = new Male("Mr", firstname, lastname);
                    personlist.Add(male);
                    string malereturn = male.ReturnName();
                    listBoxOutPut.Items.Add(malereturn);
                }
            }
        }
コード例 #30
0
        static void Main(string[] args)
        {
            var bmw = new Modern("BMW", "R1150-RT", 2005);

            var honda = new Vintage("Honda", "Nighthawk 700SC", 1986);

            var grassroots = new IPA("Calfkiller", "Grassroots", 5.7, "unknown");

            var getUpGetDown = new Stout("Wiseacre", "Gotta Get Up To Get Down", 5, true);

            var elijah = new Bourbon("Elijah Craig", "Small Batch", "94", "Kentucky");

            var balcones = new Bourbon("Balcones", "True Blue", "100", "Texas");

            var sarah = new Female("Sarah", "Silverman", "Jesus Is Magic");

            var cross = new Male("David", "Cross", "Mr. Show");


            Console.WriteLine("These are my current favorite motorcycles:");
            Console.WriteLine(bmw.Year + " " + bmw.Make + " " + bmw.Model);
            Console.WriteLine(honda.Year + " " + honda.Make + " " + honda.Model);
            Console.WriteLine("");
            Console.WriteLine("These are some of my favorite beers:");
            Console.WriteLine(grassroots.Brand + " " + grassroots.Name + " is " + grassroots.Abv + "%");
            Console.WriteLine(getUpGetDown.Brand + " " + getUpGetDown.Name + " is a " + getUpGetDown.Abv + "%");
            Console.WriteLine("");
            Console.WriteLine("These are some of my favorite whiskeys:");
            Console.WriteLine(elijah.Brand + " " + elijah.Name + " is " + elijah.Proof + " proof");
            Console.WriteLine(balcones.Brand + " " + balcones.Name + " is " + balcones.Proof + " proof");
            Console.WriteLine("");
            Console.WriteLine("These are some of my favorite comedians:");
            Console.WriteLine(sarah.FirstName + " " + sarah.LastName + " was awesome in '" + sarah.BestWork + "'");
            Console.WriteLine(cross.FirstName + " " + cross.LastName + " was awesome in '" + cross.BestWork + "'");

            Console.ReadKey();
        }
コード例 #31
0
 // Constructor
 public PersonWorld(PersonFactory factory)
 {
     _male = factory.CreateMale();
     _female = factory.CreateFemale();
 }
コード例 #32
0
 public abstract void F**k(Male m);
コード例 #33
0
 public override void F**k(Male m)
 {
     // F**k Men
     Console.WriteLine(this.GetType().Name + " f***s " + m.GetType().Name);
 }
コード例 #34
0
 public void GetPerson()
 {
     var male = new Male();
     var feMale = new FeMale();
 }
 public void should_get_M_code_given_is_male()
 {
     var male = new Male();
     Assert.Equal("M", male.GetCode());
 }