Beispiel #1
0
        public UserSettings setSmoking(Smoking smoking)
        {
            switch (smoking)
            {
            case Smoking.NEGATIVE:
            {
                                        #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
                getInstance().setSmoking(1);
                                        #endif
                return(this);
            }

            case Smoking.NEUTRAL:
            {
                                        #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
                getInstance().setSmoking(2);
                                        #endif
                return(this);
            }

            case Smoking.POSITIVE:
            {
                                        #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
                getInstance().setSmoking(3);
                                        #endif
                return(this);
            }
            }
            return(null);
        }
Beispiel #2
0
        public void init()
        {
            this.source = "";
            this.destination = "";
            this._date = "";
            this.fromTime = "";
            this.toTime = "";
            this.smoking = Smoking.dontCare;

            classInit();
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Drinking.GetHashCode();
         hashCode = (hashCode * 397) ^ Smoking.GetHashCode();
         hashCode = (hashCode * 397) ^ CleaningSchedule.GetHashCode();
         hashCode = (hashCode * 397) ^ Animals.GetHashCode();
         return(hashCode);
     }
 }
        public void Calculate()
        {
            UserInput input     = new UserInput();
            var       GetPerson = new Person();
            var       drinks    = new Drinking();
            var       smoking   = new Smoking();

            input.userInput();
            int ageToLive = GetPerson.PersonsAge - (drinks.NumberOfyears / 2);

            ageToLive = GetPerson.PersonsAge - (smoking.NumberOfyears / 2);
            Console.WriteLine("Age to live is: " + ageToLive);
        }
Beispiel #5
0
        public void userInput()
        {
            var GetPerson = new Person();
            var drinks    = new Drinking();
            var smoking   = new Smoking();

            GetPerson.GetClientInfo();
            drinks.CalculateLifeExpectancy();
            smoking.CalculateLifeExpectancy();


            GetPerson.PersonGender.ToString();
            var dringkNumberOfyers = drinks.NumberOfyears;
            var smokesnumberOfYers = smoking.NumberOfyears;
        }
Beispiel #6
0
        ///<inheritdoc/>
        public override int GetHashCode()
        {
            int hash = 17;

            // Overflow is fine, just wrap
            unchecked
            {
                hash = (hash * 29) + PercentComplete.GetHashCode();
                hash = (hash * 29) + Damage.GetHashCode();
                hash = (hash * 29) + Predistributed.GetHashCode();
                hash = (hash * 29) + State.GetHashCode();
                hash = (hash * 29) + Smoking.GetHashCode();
                hash = (hash * 29) + Flaming.GetHashCode();
            }

            return(hash);
        }
Beispiel #7
0
 public UserSettings setSmoking(Smoking smoking)
 {
     switch(smoking) {
         case Smoking.NEGATIVE:
         {
             #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
             getInstance().setSmoking(1);
             #endif
             return this;
         }
         case Smoking.NEUTRAL:
         {
             #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
             getInstance().setSmoking(2);
             #endif
             return this;
         }
         case Smoking.POSITIVE:
         {
             #if UNITY_ANDROID && !UNITY_EDITOR || UNITY_IPHONE && !UNITY_EDITOR
             getInstance().setSmoking(3);
             #endif
             return this;
         }
     }
     return null;
 }
Beispiel #8
0
        /// <summary>
        /// PublishRide - Use 'PublishRideParams' to pass parameters into this method.
        /// </summary>
        public void PublishRide(Smoking smoking)
        {
            #region Variable Declarations
            HtmlEdit uIPublishInputEdit = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPublishInputEdit;
            HtmlEdit uIPublishInputEdit11 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPublishInputEdit11;
            HtmlSpan uIDestinationPane = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPublishContentLeftPane.UIDestinationPane;
            HtmlEdit uIDateEdit2 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIDateEdit2;
            HtmlDiv uIPublishContentRightPane = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPublishContentRightPane;
            HtmlEdit uIPublishFromTimeInputEdit = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPublishFromTimeInputEdit;
            HtmlEdit uIPublishToTimeInputEdit = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPublishToTimeInputEdit;
            HtmlRadioButton uINORadioButton2 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UINORadioButton2;
            HtmlRadioButton uIYesRadioButton2 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIYesRadioButton2;
            HtmlRadioButton uIDontcareRadioButton2 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIDontcareRadioButton2;
            HtmlEdit uIPostInputEdit2 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPostInputEdit2;
            HtmlEdit uIPublishInputEdit2 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPublishInputEdit2;
            HtmlInputButton uIPublishButton = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPublishButton;
            #endregion

            // Type 'Beersheba, Israel' in 'publishInput' text box
            uIPublishInputEdit.Text = this.PublishRideParams.UIPublishInputEditText;
            Thread.Sleep(2000);
            Keyboard.SendKeys("{Down}");
            Keyboard.SendKeys("{Enter}");

            // Type 'Haifa, Israel' in 'publishInput' text box
            uIPublishInputEdit11.Text = this.PublishRideParams.UIPublishInputEdit11Text;
            Thread.Sleep(2000);
            Keyboard.SendKeys("{Down}");
            Keyboard.SendKeys("{Enter}");

            // Type '2015-07-29' in 'Date' text box
            uIDateEdit2.Text = this.PublishRideParams.UIDateEdit2Text;

            // Click 'publishContentRight' pane
            Mouse.Click(uIPublishContentRightPane, new Point(102, 101));

            // Type '18:49' in 'publishFromTimeInput' text box
            uIPublishFromTimeInputEdit.Text = this.PublishRideParams.UIPublishFromTimeInputEditText;

            // Type '18:49' in 'publishToTimeInput' text box
            uIPublishToTimeInputEdit.Text = this.PublishRideParams.UIPublishToTimeInputEditText;

            // Select 'No' radio button
            if (smoking == Smoking.no)
                uINORadioButton2.Selected = this.PublishRideParams.UINORadioButton2Selected;

            // Select 'Yes' radio button
            if(smoking == Smoking.yes)
                uIYesRadioButton2.Selected = this.PublishRideParams.UIYesRadioButton2Selected;

            // Select 'Dont care' radio button
            if (smoking == Smoking.dontCare)
                uIDontcareRadioButton2.Selected = this.PublishRideParams.UIDontcareRadioButton2Selected;

            // Type '4' in 'postInput' text box
            uIPostInputEdit2.Text = this.PublishRideParams.UIPostInputEdit2Text;

            // Type '40' in 'publishInput' text box
            uIPublishInputEdit2.Text = this.PublishRideParams.UIPublishInputEdit2Text;

            // Click 'Publish' button
            Mouse.Click(uIPublishButton, new Point(83, 10));
        }
Beispiel #9
0
        /// <summary>
        /// PostRequest - Use 'PostRequestParams' to pass parameters into this method.
        /// </summary>
        public void PostRequest(Smoking smoking, Bags bags)
        {
            #region Variable Declarations
            HtmlEdit uIPostInputEdit = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPostInputEdit;
            HtmlSpan uIBeershebaPane1 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIBeershebaPane1;
            HtmlEdit uIPostInputEdit1 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPostInputEdit1;
            HtmlSpan uIIsraelPane1 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIIsraelPane1;
            HtmlRadioButton uINORadioButton1 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UINORadioButton1;
            HtmlRadioButton uIYesRadioButton1 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIYesRadioButton1;
            HtmlRadioButton uIDontcareRadioButton1 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIDontcareRadioButton1;
            HtmlRadioButton uIBigbagRadioButton1 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIBigbagRadioButton1;
            HtmlRadioButton uINoneSmallbagRadioButton1 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UINoneSmallbagRadioButton1;
            HtmlEdit uIDateEdit1 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIDateEdit1;
            HtmlEdit uIPostFromTimeInputEdit1 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPostFromTimeInputEdit1;
            HtmlEdit uIPostToTimeInputEdit1 = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPostToTimeInputEdit1;
            HtmlInputButton uIPostButton = this.UIRideShareWindowsInteWindow.UIRideShareDocument.UIPostContentPane2.UIPostButton;
            #endregion

            // Type 'beersheba' in 'postInput' text box
            uIPostInputEdit.Text = this.PostRequestParams.UIPostInputEditText;
            Thread.Sleep(2000);
            Keyboard.SendKeys("{Down}");
            Keyboard.SendKeys("{Enter}");
            //try
            //{
            //    // Click 'Beersheba' pane
            //    Mouse.Click(uIBeershebaPane1, new Point(641, 348));
            //}
            //catch { }

            // Type 'haifa' in 'postInput' text box
            uIPostInputEdit1.Text = this.PostRequestParams.UIPostInputEdit1Text;
            Thread.Sleep(2000);
            Keyboard.SendKeys("{Down}");
            Keyboard.SendKeys("{Enter}");
            //try
            //{
            //    // Click 'Israel' pane
            //    Mouse.Click(uIIsraelPane1, new Point(20, 4));
            //}
            //catch { }

            // Select 'No' radio button
            if (smoking == Smoking.no)
                uINORadioButton1.Selected = this.PostRequestParams.UINORadioButton1Selected;

            // Select 'Yes' radio button
            if (smoking == Smoking.yes)
                uIYesRadioButton1.Selected = this.PostRequestParams.UIYesRadioButton1Selected;

            // Select 'Dont care' radio button
            if (smoking == Smoking.dontCare)
                uIDontcareRadioButton1.Selected = this.PostRequestParams.UIDontcareRadioButton1Selected;

            // Select 'Big bag' radio button
            if (bags == Bags.big_bag)
                uIBigbagRadioButton1.Selected = this.PostRequestParams.UIBigbagRadioButton1Selected;

            // Select 'None/Small bag' radio button
            if (bags == Bags.none)
                uINoneSmallbagRadioButton1.Selected = this.PostRequestParams.UINoneSmallbagRadioButton1Selected;

            // Type '2015-07-28' in 'Date' text box
            uIDateEdit1.Text = this.PostRequestParams.UIDateEdit1Text;

            // Type '02:36' in 'postFromTimeInput' text box
            uIPostFromTimeInputEdit1.Text = this.PostRequestParams.UIPostFromTimeInputEdit1Text;

            // Type '02:37' in 'postToTimeInput' text box
            uIPostToTimeInputEdit1.Text = this.PostRequestParams.UIPostToTimeInputEdit1Text;

            // Click 'Post' button
            Mouse.Click(uIPostButton, new Point(68, 12));
        }
Beispiel #10
0
        private Card RandomCard(Vector2 position, bool front, int playerID)
        {
            Card c = null;

            if (Globals.r.Next(4) == 0)
            {
                int cardsCount = 31;
                int rn         = Globals.r.Next(cardsCount);
                switch (rn)
                {
                case 0:
                    c = new Actor(position, front, playerID);
                    break;

                case 1:
                    c = new Artist(position, front, playerID);
                    break;

                case 2:
                    c = new Astrophysicist(position, front, playerID);
                    break;

                case 3:
                    c = new Babysitter(position, front, playerID);
                    break;

                case 4:
                    c = new BabysitterU(position, front, playerID);
                    break;

                case 5:
                    c = new BusDriver(position, front, playerID);
                    break;

                case 6:
                    c = new Conman(position, front, playerID);
                    break;

                case 7:
                    c = new DeliveryPerson(position, front, playerID);
                    break;

                case 8:
                    c = new DrugDealer(position, front, playerID);
                    break;

                case 9:
                    c = new FastFoodEmployee(position, front, playerID);
                    break;

                case 10:
                    c = new Hacker(position, front, playerID);
                    break;

                case 11:
                    c = new Hitman(position, front, playerID);
                    break;

                case 12:
                    c = new HumanTrafficker(position, front, playerID);
                    break;

                case 13:
                    c = new IndieGameDev(position, front, playerID);
                    break;

                case 14:
                    c = new Influencer(position, front, playerID);
                    break;

                case 15:
                    c = new InstaModel(position, front, playerID);
                    break;

                case 16:
                    c = new InternDev(position, front, playerID);
                    break;

                case 17:
                    c = new JuniorDev(position, front, playerID);
                    break;

                case 18:
                    c = new Musician(position, front, playerID);
                    break;

                case 19:
                    c = new OnlyFans(position, front, playerID);
                    break;

                case 20:
                    c = new Referee(position, front, playerID);
                    break;

                case 21:
                    c = new RiceFarmer(position, front, playerID);
                    break;

                case 22:
                    c = new Santa(position, front, playerID);
                    break;

                case 23:
                    c = new Shelfstacker(position, front, playerID);
                    break;

                case 24:
                    c = new Shoplifter(position, front, playerID);
                    break;

                case 25:
                    c = new Sporter(position, front, playerID);
                    break;

                case 27:
                    c = new Streamer(position, front, playerID);
                    break;

                case 28:
                    c = new SugarDaddy(position, front, playerID);
                    break;

                case 29:
                    c = new TaxiDriver(position, front, playerID);
                    break;

                case 30:
                    c = new Writer(position, front, playerID);
                    break;

                case 26:
                    c = new YogaInstructor(position, front, playerID);
                    break;
                }
            }
            else
            {
                int cardsCount = 12;
                int rn         = Globals.r.Next(cardsCount);
                switch (rn)
                {
                case 0:
                    c = new Alcohol(position, front, playerID);
                    break;

                case 1:
                    c = new Drugs(position, front, playerID);
                    break;

                case 2:
                    c = new EatingOut(position, front, playerID);
                    break;

                case 3:
                    c = new FastFood(position, front, playerID);
                    break;

                case 4:
                    c = new Gambling(position, front, playerID);
                    break;

                case 5:
                    c = new Gaming(position, front, playerID);
                    break;

                case 6:
                    c = new Joint(position, front, playerID);
                    break;

                case 7:
                    c = new PomXML(position, front, playerID);
                    break;

                case 8:
                    c = new Shopping(position, front, playerID);
                    break;

                case 9:
                    c = new Smoking(position, front, playerID);
                    break;

                case 10:
                    c = new SocialMedia(position, front, playerID);
                    break;

                case 11:
                    c = new Streaming(position, front, playerID);
                    break;
                }
            }

            return(c);
        }
Beispiel #11
0
        internal static PatientEntity ReadPatientFromDictionary(IDictionary <string, string> patientProperties)
        {
            var ruCulture = new CultureInfo("RU-ru");

            //  Create patient instance

            var patient = new PatientEntity
            {
                Id           = Guid.NewGuid().ToString(),
                VisitHistory = new List <PatientVisitEntity>()
            };

            patient.HypertensionDuration = double.TryParse(patientProperties["HDurability"], out var duration) ? duration : 0;
            patient.TreatmentDuration    = double.TryParse(patientProperties["treatment"], out var treatment) && (treatment > 0) ? patient.HypertensionDuration : 0;

            patient.HypertensionAncestralAnamnesis = int.TryParse(patientProperties["Hheredity"], out var anamnesis)
                ? (HypertensionAncestralAnamnesis)anamnesis
                : HypertensionAncestralAnamnesis.None;

            var nameParts = patientProperties["name"].Split(' ');

            patient.Name       = nameParts[1];
            patient.Surname    = nameParts[0];
            patient.MiddleName = nameParts[2];

            patient.BirthDateTicks = (DateTime.Today - TimeSpan.FromDays(Convert.ToInt32(patientProperties["age"]) * 365)).Ticks;

            patient.Gender = patientProperties["gender"].IndexOfAny(new[] { 'ж', 'Ж' }) != -1 ? GenderType.Female : GenderType.Male;

            patient.MedicineSerialized = "[]";

            if (!string.IsNullOrEmpty(patientProperties["MaleHeredity"]))
            {
                patient.MaleHeredity = Convert.ToBoolean(Convert.ToInt32(patientProperties["MaleHeredity"]));
            }

            if (!string.IsNullOrEmpty(patientProperties["FemaleHeredity"]))
            {
                patient.FemaleHeredity = Convert.ToBoolean(Convert.ToInt32(patientProperties["FemaleHeredity"]));
            }

            var genes = new Dictionary <string, Gene>();

            if (!string.IsNullOrEmpty(patientProperties[GenesNames.Agt]))
            {
                genes[GenesNames.Agt] = new Gene(GenesNames.Agt, Convert.ToInt32(patientProperties[GenesNames.Agt]));
            }
            if (!string.IsNullOrEmpty(patientProperties[GenesNames.Agtr2]))
            {
                genes[GenesNames.Agtr2] = new Gene(GenesNames.Agtr2, Convert.ToInt32(patientProperties[GenesNames.Agtr2]));
            }
            if (!string.IsNullOrEmpty(patientProperties[GenesNames.Agtr1]))
            {
                genes[GenesNames.Agtr1] = new Gene(GenesNames.Agtr1, Convert.ToInt32(patientProperties[GenesNames.Agtr1]));
            }
            if (!string.IsNullOrEmpty(patientProperties[GenesNames.Nos]))
            {
                genes[GenesNames.Nos] = new Gene(GenesNames.Nos, Convert.ToInt32(patientProperties[GenesNames.Nos]));
            }
            if (!string.IsNullOrEmpty(patientProperties[GenesNames.Cyp11B2]))
            {
                genes[GenesNames.Cyp11B2] = new Gene(GenesNames.Cyp11B2, Convert.ToInt32(patientProperties[GenesNames.Cyp11B2]));
            }
            if (!string.IsNullOrEmpty(patientProperties[GenesNames.Mthfr]))
            {
                genes[GenesNames.Mthfr] = new Gene(GenesNames.Mthfr, Convert.ToInt32(patientProperties[GenesNames.Mthfr]));
            }

            patient.GenesSerialized = JsonConvert.SerializeObject(genes);

            //  Create patient visit instance

            var patientVisit = new PatientVisitEntity {
                PatientId = Guid.NewGuid().ToString(), VisitDateTicks = new DateTime(2015, 1, 1).Ticks
            };

            Smoking smoking;

            if (patientProperties["smoke"].Contains("1"))
            {
                smoking = new Smoking {
                    Type = SmokingType.Never
                }
            }
            ;
            else if (patientProperties["smoke"].Contains("2"))
            {
                smoking = new Smoking {
                    Type = SmokingType.InPast
                }
            }
            ;
            else
            {
                smoking = new Smoking {
                    Type = SmokingType.Now
                }
            };

            patientVisit.SmokingSeralized = JsonConvert.SerializeObject(smoking);

            patientVisit.BloodPressureSerialized   = "";
            patientVisit.DietaryHabitsSerialized   = "";
            patientVisit.SaltSensitivitySerialized = "";

            if (patientProperties["HStage"].Contains("1"))
            {
                patientVisit.HypertensionStage = HypertensionStage.Stage1;
            }
            if (patientProperties["HStage"].Contains("2"))
            {
                patientVisit.HypertensionStage = HypertensionStage.Stage2;
            }
            if (patientProperties["HStage"].Contains("3"))
            {
                patientVisit.HypertensionStage = HypertensionStage.Stage3;
            }
            if (patientProperties["HStage"].Contains("зд"))
            {
                patientVisit.HypertensionStage = HypertensionStage.Healthy;
            }

            if (!string.IsNullOrEmpty(patientProperties["WaistCircumference"]))
            {
                patientVisit.WaistCircumference = Convert.ToDouble(patientProperties["WaistCircumference"], ruCulture);
            }

            if (!string.IsNullOrEmpty(patientProperties["Height"]))
            {
                patientVisit.Height = Convert.ToDouble(patientProperties["Height"]);
            }
            if (!string.IsNullOrEmpty(patientProperties["Weight"]))
            {
                patientVisit.Weight = Convert.ToDouble(patientProperties["Weight"]);
            }

            if (patientProperties["HStage"].Contains("1"))
            {
                patientVisit.HypertensionStage = HypertensionStage.Stage1;
            }
            else if (patientProperties["HStage"].Contains("2"))
            {
                patientVisit.HypertensionStage = HypertensionStage.Stage2;
            }
            else if (patientProperties["HStage"].Contains("3"))
            {
                patientVisit.HypertensionStage = HypertensionStage.Stage3;
            }
            else
            {
                patientVisit.HypertensionStage = HypertensionStage.Healthy;
            }

            if (!string.IsNullOrEmpty(patientProperties["phiz"]))
            {
                var phiz = Convert.ToInt32(patientProperties["phiz"]);
                if (phiz == 4)
                {
                    patientVisit.PhysicalActivity = PhysicalActivity.MoreThenThreeTimesPerWeek;
                }
                else if (phiz == 3)
                {
                    patientVisit.PhysicalActivity = PhysicalActivity.FromOneToThreeTimesPerWeek;
                }
                else if (phiz == 2)
                {
                    patientVisit.PhysicalActivity = PhysicalActivity.OncePerWeekOrLess;
                }
                else
                {
                    patientVisit.PhysicalActivity = PhysicalActivity.Never;
                }
            }

            //  Compose patient and return
            patientVisit.PatientId = patient.Id;
            patient.VisitHistory.Add(patientVisit);
            return(patient);
        }

        #endregion
    }