Example #1
0
        private void UpdateTexts()
        {
            for (int i = 0; i < colony_.Colonist.Count; i++)
            {
                Men colonist = colony_.Colonist[i];

                texts_[i + 1][0].DisplayedString = $"{colonist.Name}";
                texts_[i + 1][1].DisplayedString = $"{colonist.HP.Value:F2}";
                texts_[i + 1][2].DisplayedString = $"{colonist.RestF.Value:F2}";
                texts_[i + 1][3].DisplayedString = $"{colonist.Morale.Value:F2}";

                string jobS = string.Empty;
                if (colonist.Job != null)
                {
                    if (colonist.Job.GetType() == typeof(Men.AttackJob))
                    {
                        jobS += "Atakuje";
                    }
                    else if (colonist.Job.GetType() == typeof(Men.FleeJob))
                    {
                        jobS += "Ucieka";
                    }
                    else if (colonist.Job.GetType() == typeof(Men.RestJob))
                    {
                        jobS += "Odpoczywa";
                    }
                    else if (colonist.Job.GetType() == typeof(Construct.ConstructingJob))
                    {
                        jobS += "Buduje";
                    }
                }

                texts_[i + 1][4].DisplayedString = jobS;
            }
        }
Example #2
0
    void End()
    {
        jishi += Time.deltaTime;

        if (jishi <= endJishi)
        {
            return;
        }

        if (PlayerUI && PlayerUI.activeSelf)
        {
            Globals.isInPlot = true;
            //PlayerUI.SetActive(false);
            PlayerUI.GetComponent <CanvasGroup>().alpha = 0;
        }



        if (GlobalLight.GetComponent <Light2D>().intensity >= 300)
        {
            print("游戏通关!!!!!");
            //进入另一个 场景
            PlayerUI.GetComponent <CanvasGroup>().alpha = 1;
            PlayerUI.GetComponent <PlayerUI>().HideUIs();
            Men.SetActive(true);
            Globals.isInPlot = false;
            return;
        }


        GlobalLight.GetComponent <Light2D>().intensity += (302 - GlobalLight.GetComponent <Light2D>().intensity) * 0.01f;
    }
Example #3
0
        public IActionResult Edit(Men model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View(model));
                }

                if (model.Id == 0)
                {
                    _repository.Insert(model);
                }
                else
                {
                    _repository.Update(model);
                }

                return(RedirectToAction(nameof(List)));
            }
            catch (NotFoundException)
            {
                return(NotFound());
            }
        }
Example #4
0
        static void Main(string[] args)
        {
            Men men = new Men();

            men.newSearch();

            Console.ReadKey();
        }
Example #5
0
        public ActionResult DeleteConfirmed(int id)
        {
            Men men = db.MenSet.Find(id);

            db.MenSet.Remove(men);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #6
0
 public SleepJob(Men owner, Bed bed)
 {
     owner_ = owner;
     if (bed != null)
     {
         bed_        = bed;
         bed_.IsFree = false;
     }
 }
Example #7
0
 public ActionResult Edit([Bind(Include = "id,name,imageUrl,price")] Men men)
 {
     if (ModelState.IsValid)
     {
         db.Entry(men).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(men));
 }
Example #8
0
 public IActionResult WhiteResult(Men menScore)
 {
     menScore.courseRating = 67.4;
     menScore.slopeRating  = 123;
     menScore.scoreAvg     = (menScore.score1 + menScore.score2 + menScore.score3
                              + menScore.score4 + menScore.score5) / 5;
     menScore.handicap = (menScore.scoreAvg - menScore.courseRating) * 113 / menScore.slopeRating;
     menScore.handicap = Math.Round(menScore.handicap, 0);
     return(View(menScore));
 }
Example #9
0
        static public void Run()
        {
            Console.WriteLine("------------Bridge------------");
            Men men = new Men(new Hunting());

            men.Do();

            men.FoodExtracting = new Fishsing();
            men.Do();
        }
Example #10
0
        public ActionResult Create([Bind(Include = "id,name,imageUrl,price")] Men men)
        {
            if (ModelState.IsValid)
            {
                db.MenSet.Add(men);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(men));
        }
Example #11
0
        public void Matching()
        {
            while (Relationships.Count < N)
            {
                //Console.WriteLine("---------\n");
                for (ushort m = 0; m < Men.Count; m++)
                {
                    Person man = Men[m];

                    if (man.IsSingle)
                    {
                        for (ushort p = 0; p < man.Preferences.Count; p++)
                        {
                            Person manPreference = Women.Find(w => w.Name == man.Preferences[p].Name);

                            if (!man.RefusedBy.Contains(manPreference))
                            {
                                //Console.WriteLine($"{man} z {manPreference}: ");

                                if (manPreference.IsSingle)
                                {
                                    man.CreateRelationShip(ref manPreference);
                                    Relationships.Add(man);

                                    //Console.WriteLine("Związali się");

                                    break;
                                }
                                else if (man.IsBetterThanRival(manPreference.RelationshipWith, manPreference))
                                {
                                    Person rival = Men.Find(r => r.Name == manPreference.RelationshipWith.Name);
                                    rival.Deserted(manPreference);
                                    Relationships.Remove(rival);

                                    man.CreateRelationShip(ref manPreference);
                                    Relationships.Add(man);

                                    //Console.WriteLine($"Związali się i zniszczyli życie {rival}");

                                    break;
                                }
                                else
                                {
                                    man.AddRefusedProposal(manPreference);
                                    //Console.WriteLine("Nie zostaną nigdy małżeństwem");
                                }
                            }
                        }
                    }
                }
            }
        }
    // Use this for initialization
    void Start()
    {
        MatchMaker men   = new Men(45, 20000, 99, 0);
        MatchMaker women = new Women(18, 0, 60, 0);

        WomenMatcherMakerMediator mediator = new WomenMatcherMakerMediator(men, women);

        mediator.OfferMenInformation();
        mediator.OfferWomenInformation();

        Debug.Log("男方目前的好感度是" + men.m_favor);
        Debug.Log("nv方目前的好感度是" + women.m_favor);
    }
Example #13
0
        // GET: Men/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Men men = db.MenSet.Find(id);

            if (men == null)
            {
                return(HttpNotFound());
            }
            return(View(men));
        }
Example #14
0
        public static bool MatchCouple(Men men, Women womem)
        {
            int similarity = 0;

            if (MatchEyes(men, womem))
            {
                similarity++;
            }
            if (MatchGrowth(men, womem))
            {
                similarity++;
            }
            if (MatchAge(men, womem))
            {
                similarity++;
            }
            return(similarity >= minimalSimilarity);
        }
Example #15
0
        private static bool MatchAge(Men men, Women womem)
        {
            DateTime minAge;
            DateTime maxAge;

            if (men.DateBirth < womem.DateBirth)
            {
                minAge = men.DateBirth;
                maxAge = womem.DateBirth;
            }
            else
            {
                maxAge = men.DateBirth;
                minAge = womem.DateBirth;
            }
            const int maxDifrentYears = 5;

            return(minAge.AddYears(maxDifrentYears) > maxAge);
        }
Example #16
0
 private void OnEnable()
 {
     if (!general.review)
     {
         general.enunciado.SetActive(false);
         general.toggleMan.gameObject.SetActive(false);
         general.toggleWoman.gameObject.SetActive(false);
         if (w)
         {
             Woman.SetActive(true);
             if (general.correctas == ControlPuntaje.questions)
             {
                 Woman.transform.GetChild(0).gameObject.SetActive(true);
                 Woman.transform.GetChild(1).gameObject.SetActive(false);
             }
             else
             {
                 Woman.transform.GetChild(0).gameObject.SetActive(false);
                 Woman.transform.GetChild(1).gameObject.SetActive(true);
             }
         }
         if (m)
         {
             Men.SetActive(true);
             if (general.correctas == ControlPuntaje.questions)
             {
                 Men.transform.GetChild(0).gameObject.SetActive(true);
                 Men.transform.GetChild(1).gameObject.SetActive(false);
             }
             else
             {
                 Men.transform.GetChild(0).gameObject.SetActive(false);
                 Men.transform.GetChild(1).gameObject.SetActive(true);
             }
         }
     }
 }
Example #17
0
        public JsonResult BarChart()
        {
            Men        men          = new Men();
            Women      women        = new Women();
            List <int> totalHombres = new List <int>();
            List <int> totalMujeres = new List <int>();

            var assistances = assistanceRepository.GetAssistances().Where(a => a.assistanceDate.Year == DateTime.Now.Year).ToList();

            try
            {
                foreach (var item in assistances)
                {
                    #region GetCliente
                    Client c = clientRepository.GetClientByID(item.ClientID);
                    if (c == null)
                    {
                        continue;
                    }
                    #endregion

                    #region Calculo de Edad,  de Clasificacion en Edad y lo cuento
                    var today = DateTime.Today;
                    var age   = today.Year - c.BirthDate.Year;
                    if (c.BirthDate > today.AddYears(-age))
                    {
                        age--;
                    }

                    if (c.Sexo.Equals(Utils.Catalog.Genre.Hombre))
                    {
                        if (age < 36)
                        {
                            men.YoungAdult++;
                        }
                        else if (age < 51)
                        {
                            men.Adult++;
                        }
                        else if (age < 65)
                        {
                            men.MiddleAge++;
                        }
                        else
                        {
                            men.Senior++;
                        }
                    }
                    else
                    {
                        if (age < 36)
                        {
                            women.YoungAdult++;
                        }
                        else if (age < 51)
                        {
                            women.Adult++;
                        }
                        else if (age < 65)
                        {
                            women.MiddleAge++;
                        }
                        else
                        {
                            women.Senior++;
                        }
                    }
                    #endregion
                }

                #region Listas para el front
                totalHombres.Insert(0, men.YoungAdult);
                totalHombres.Insert(1, men.Adult);
                totalHombres.Insert(2, men.MiddleAge);
                totalHombres.Insert(3, men.Senior);
                totalMujeres.Insert(0, women.YoungAdult);
                totalMujeres.Insert(1, women.Adult);
                totalMujeres.Insert(2, women.MiddleAge);
                totalMujeres.Insert(3, women.Senior);
                #endregion
            }
            catch (Exception ex)
            {
                return(Json(new { Result = "NOOK", Error = ex.Message }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new { Result = "OK", Men = totalHombres, Women = totalMujeres }, JsonRequestBehavior.AllowGet));
        }
Example #18
0
 public void RemoveBesiger(Men besiger)
 {
     map_.UpdateTimeEvent -= besiger.UpdateTime;
     besigersToRemove_.Add(besiger);
 }
 public ActionResult Men(Men men)
 {
     return(ComonPersonPost(men));
 }
Example #20
0
 private static bool MatchEyes(Men men, Women womem)
 {
     return(men.EyesColor == womem.EyesColor);
 }
Example #21
0
 private static bool MatchGrowth(Men men, Women womem)
 {
     return(men.Growth - 10 > womem.Growth);
 }
 public IActionResult Men(Men men)// w klasie person jest opis
 {
     return(View());
 }
        void ReleaseDesignerOutlets()
        {
            if (AccountData != null)
            {
                AccountData.Dispose();
                AccountData = null;
            }

            if (AccountDataSection != null)
            {
                AccountDataSection.Dispose();
                AccountDataSection = null;
            }

            if (BottomConstraint != null)
            {
                BottomConstraint.Dispose();
                BottomConstraint = null;
            }

            if (Cancel != null)
            {
                Cancel.Dispose();
                Cancel = null;
            }

            if (ChangePassword != null)
            {
                ChangePassword.Dispose();
                ChangePassword = null;
            }

            if (ChangePasswordSection != null)
            {
                ChangePasswordSection.Dispose();
                ChangePasswordSection = null;
            }

            if (CheckUsername != null)
            {
                CheckUsername.Dispose();
                CheckUsername = null;
            }

            if (ConfirmPassword != null)
            {
                ConfirmPassword.Dispose();
                ConfirmPassword = null;
            }

            if (ConfirmPasswordLabel != null)
            {
                ConfirmPasswordLabel.Dispose();
                ConfirmPasswordLabel = null;
            }

            if (DeactivateAccount != null)
            {
                DeactivateAccount.Dispose();
                DeactivateAccount = null;
            }

            if (DeleteAccount != null)
            {
                DeleteAccount.Dispose();
                DeleteAccount = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (DescriptionText != null)
            {
                DescriptionText.Dispose();
                DescriptionText = null;
            }

            if (DistanceShareAll != null)
            {
                DistanceShareAll.Dispose();
                DistanceShareAll = null;
            }

            if (DistanceShareAllLabel != null)
            {
                DistanceShareAllLabel.Dispose();
                DistanceShareAllLabel = null;
            }

            if (DistanceShareFriend != null)
            {
                DistanceShareFriend.Dispose();
                DistanceShareFriend = null;
            }

            if (DistanceShareFriendLabel != null)
            {
                DistanceShareFriendLabel.Dispose();
                DistanceShareFriendLabel = null;
            }

            if (DistanceShareLabel != null)
            {
                DistanceShareLabel.Dispose();
                DistanceShareLabel = null;
            }

            if (DistanceShareLike != null)
            {
                DistanceShareLike.Dispose();
                DistanceShareLike = null;
            }

            if (DistanceShareLikeLabel != null)
            {
                DistanceShareLikeLabel.Dispose();
                DistanceShareLikeLabel = null;
            }

            if (DistanceShareMatch != null)
            {
                DistanceShareMatch.Dispose();
                DistanceShareMatch = null;
            }

            if (DistanceShareMatchLabel != null)
            {
                DistanceShareMatchLabel.Dispose();
                DistanceShareMatchLabel = null;
            }

            if (DistanceShareNone != null)
            {
                DistanceShareNone.Dispose();
                DistanceShareNone = null;
            }

            if (DistanceShareNoneLabel != null)
            {
                DistanceShareNoneLabel.Dispose();
                DistanceShareNoneLabel = null;
            }

            if (EditImagesUploaded != null)
            {
                EditImagesUploaded.Dispose();
                EditImagesUploaded = null;
            }

            if (Email != null)
            {
                Email.Dispose();
                Email = null;
            }

            if (EmailLabel != null)
            {
                EmailLabel.Dispose();
                EmailLabel = null;
            }

            if (ImageEditor != null)
            {
                ImageEditor.Dispose();
                ImageEditor = null;
            }

            if (ImageEditorCancel != null)
            {
                ImageEditorCancel.Dispose();
                ImageEditorCancel = null;
            }

            if (ImageEditorControls != null)
            {
                ImageEditorControls.Dispose();
                ImageEditorControls = null;
            }

            if (ImageEditorFrame != null)
            {
                ImageEditorFrame.Dispose();
                ImageEditorFrame = null;
            }

            if (ImageEditorFrameBorder != null)
            {
                ImageEditorFrameBorder.Dispose();
                ImageEditorFrameBorder = null;
            }

            if (ImageEditorLabel != null)
            {
                ImageEditorLabel.Dispose();
                ImageEditorLabel = null;
            }

            if (ImageEditorOK != null)
            {
                ImageEditorOK.Dispose();
                ImageEditorOK = null;
            }

            if (ImageEditorStatus != null)
            {
                ImageEditorStatus.Dispose();
                ImageEditorStatus = null;
            }

            if (Images != null)
            {
                Images.Dispose();
                Images = null;
            }

            if (ImagesProgress != null)
            {
                ImagesProgress.Dispose();
                ImagesProgress = null;
            }

            if (ImagesProgressText != null)
            {
                ImagesProgressText.Dispose();
                ImagesProgressText = null;
            }

            if (LoaderCircle != null)
            {
                LoaderCircle.Dispose();
                LoaderCircle = null;
            }

            if (LocationSettings != null)
            {
                LocationSettings.Dispose();
                LocationSettings = null;
            }

            if (LocationSettingsSection != null)
            {
                LocationSettingsSection.Dispose();
                LocationSettingsSection = null;
            }

            if (LocationShareAll != null)
            {
                LocationShareAll.Dispose();
                LocationShareAll = null;
            }

            if (LocationShareAllLabel != null)
            {
                LocationShareAllLabel.Dispose();
                LocationShareAllLabel = null;
            }

            if (LocationShareFriend != null)
            {
                LocationShareFriend.Dispose();
                LocationShareFriend = null;
            }

            if (LocationShareFriendLabel != null)
            {
                LocationShareFriendLabel.Dispose();
                LocationShareFriendLabel = null;
            }

            if (LocationShareLabel != null)
            {
                LocationShareLabel.Dispose();
                LocationShareLabel = null;
            }

            if (LocationShareLike != null)
            {
                LocationShareLike.Dispose();
                LocationShareLike = null;
            }

            if (LocationShareLikeLabel != null)
            {
                LocationShareLikeLabel.Dispose();
                LocationShareLikeLabel = null;
            }

            if (LocationShareMatch != null)
            {
                LocationShareMatch.Dispose();
                LocationShareMatch = null;
            }

            if (LocationShareMatchLabel != null)
            {
                LocationShareMatchLabel.Dispose();
                LocationShareMatchLabel = null;
            }

            if (LocationShareNone != null)
            {
                LocationShareNone.Dispose();
                LocationShareNone = null;
            }

            if (LocationShareNoneLabel != null)
            {
                LocationShareNoneLabel.Dispose();
                LocationShareNoneLabel = null;
            }

            if (Men != null)
            {
                Men.Dispose();
                Men = null;
            }

            if (MenLabel != null)
            {
                MenLabel.Dispose();
                MenLabel = null;
            }

            if (MoreOptions != null)
            {
                MoreOptions.Dispose();
                MoreOptions = null;
            }

            if (MoreOptionsSection != null)
            {
                MoreOptionsSection.Dispose();
                MoreOptionsSection = null;
            }

            if (Name != null)
            {
                Name.Dispose();
                Name = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (NewPassword != null)
            {
                NewPassword.Dispose();
                NewPassword = null;
            }

            if (NewPasswordLabel != null)
            {
                NewPasswordLabel.Dispose();
                NewPasswordLabel = null;
            }

            if (OldPassword != null)
            {
                OldPassword.Dispose();
                OldPassword = null;
            }

            if (OldPasswordLabel != null)
            {
                OldPasswordLabel.Dispose();
                OldPasswordLabel = null;
            }

            if (ProfileEdit_Scroll != null)
            {
                ProfileEdit_Scroll.Dispose();
                ProfileEdit_Scroll = null;
            }

            if (RippleImageEditor != null)
            {
                RippleImageEditor.Dispose();
                RippleImageEditor = null;
            }

            if (RoundBottom != null)
            {
                RoundBottom.Dispose();
                RoundBottom = null;
            }

            if (Save != null)
            {
                Save.Dispose();
                Save = null;
            }

            if (ScrollBottomConstraint != null)
            {
                ScrollBottomConstraint.Dispose();
                ScrollBottomConstraint = null;
            }

            if (ScrollBottomOuterConstraint != null)
            {
                ScrollBottomOuterConstraint.Dispose();
                ScrollBottomOuterConstraint = null;
            }

            if (SexLabel != null)
            {
                SexLabel.Dispose();
                SexLabel = null;
            }

            if (Snackbar != null)
            {
                Snackbar.Dispose();
                Snackbar = null;
            }

            if (SnackBottomConstraint != null)
            {
                SnackBottomConstraint.Dispose();
                SnackBottomConstraint = null;
            }

            if (SnackTopConstraint != null)
            {
                SnackTopConstraint.Dispose();
                SnackTopConstraint = null;
            }

            if (TopSeparator != null)
            {
                TopSeparator.Dispose();
                TopSeparator = null;
            }

            if (UseLocationLabel != null)
            {
                UseLocationLabel.Dispose();
                UseLocationLabel = null;
            }

            if (UseLocationSwitch != null)
            {
                UseLocationSwitch.Dispose();
                UseLocationSwitch = null;
            }

            if (Username != null)
            {
                Username.Dispose();
                Username = null;
            }

            if (UsernameLabel != null)
            {
                UsernameLabel.Dispose();
                UsernameLabel = null;
            }

            if (ViewportConstraint != null)
            {
                ViewportConstraint.Dispose();
                ViewportConstraint = null;
            }

            if (Women != null)
            {
                Women.Dispose();
                Women = null;
            }

            if (WomenLabel != null)
            {
                WomenLabel.Dispose();
                WomenLabel = null;
            }
        }