Inheritance: IAges
Exemplo n.º 1
0
 public static Age ParseAgeString(string data)
 {
     if (string.IsNullOrEmpty(data))
     {
         return null;
     }
     var a = new Age();
     a.Number = int.Parse(data.Substring(1, 3));
     switch (data.Substring(4, 1))
     {
         case "D":
             a.Units = Age.Unit.DAYS;
             break;
         case "W":
             a.Units = Age.Unit.WEEKS;
             break;
         case "M":
             a.Units = Age.Unit.MONTHS;
             break;
         case "Y":
             a.Units = Age.Unit.YEARS;
             break;
     }
     return a;
 }
Exemplo n.º 2
0
        public Result(Age a, Sex s, Profession p, Education e, YesNo cit, 
		               List<Technology> tech, Frequency pub, Frequency home,
		               NumPass single, List<PassType> passType, Frequency pChange,
		               YesNo sharePass,YesNo pSecure, YesNo passHome,YesNo pMobile, 
		               YesNo hWifiPass, YesNo hWifiFire, YesNo hVirusSoftware, YesNo softUpdate, 
		               SecureLevel sLevel, SharePersonalInfo postPersonal, Frequency pWifi)
        {
            m_age = a;
            m_sex = s;
            m_profession = p;
            m_education = e;
            m_usCitizen = cit;
            m_technologyList = tech;
            m_publicComputer = pub;
            m_homeComputer = home;
            m_singlePass = single;
            m_passType = passType;
            m_passChangeFreq = pChange;
            m_sharePassword = sharePass;
            m_passSecure = pSecure;
            m_passHomePC = passHome;
            m_passForMobile = pMobile;
            m_homeWifiPass = hWifiPass;
            m_homeWifiFirewall = hWifiFire;
            m_homeVirusSoftware = hVirusSoftware;
            m_softwareUpdates = softUpdate;
            m_securityLevel = sLevel;
            m_postPersonalInfo = postPersonal;
            m_publicWifi = pWifi;
        }
 public AnnualPolicy(Age age, Sex gender, Destination destination, Tax tax)
 {
     this.age = age;
     this.gender = gender;
     this.destination = destination;
     this.tax = tax;
 }
Exemplo n.º 4
0
        internal Face(ServerModel.Face face)
        {
            if (face != null)
            {
                Id = face.face_id;

                if (face.attribute != null)
                {
                    Age = new Age(face.attribute.age);
                    Gender = new UncertainValue(face.attribute.gender);
                    HasGlasses = new UncertainValue(face.attribute.glass);
                    Race = new UncertainValue(face.attribute.race);
                    Smiling = new UncertainValue(face.attribute.smiling);
                }

                if (face.position != null)
                {
                    Position = new Position(face.position.center);
                    Size = new Size { Width = face.position.width, Height = face.position.height };

                    EyeLeft = new Position(face.position.eye_left);
                    EyeRight = new Position(face.position.eye_right);
                    MouthLeft = new Position(face.position.mouth_left);
                    MouthRight = new Position(face.position.mouth_right);
                    Nose = new Position(face.position.nose);
                }
            }
        }
Exemplo n.º 5
0
 public void ApplyChunk(Age.TerrainChunk chunk) {
   this.tc = chunk;
   this.SetHeights(chunk);
   this.SetTextures(chunk);
   this.td.RefreshPrototypes();
   this.GetComponent<Terrain>().Flush();
 }
Exemplo n.º 6
0
 public Watch(string title, string description, double price,int material,string manufacturer, int dateOrigin)
     : base(title,description,price)
 {
     this.material = (Material)material;
     this.manufacturer = manufacturer;
     this.dateOrigin = (Age)dateOrigin;
 }
 public SingleTripPolicy(Age age, Sex gender, Destination destination, PeriodOfTravel duration, Tax tax)
 {
     this.age = age;
     this.gender = gender;
     this.destination = destination;
     this.duration = duration;
     this.tax = tax;
 }
Exemplo n.º 8
0
 override public void MutateChunk(Age.TerrainChunk chunk, ChunkParameters parms) {
   if (parms.addMode == Age.TerrainChunk.AddMode.Max) {
     float maxHeight = .12f + (.80f * this.quantity * parms.targetHeight);
     chunk.Clamp(this.quantity * -parms.targetHeight, maxHeight);
   } else {
     chunk.Clamp(this.quantity * -parms.targetHeight, this.quantity * parms.targetHeight);
   }
 }
Exemplo n.º 9
0
 public Race()
 {
     BaseRace = string.Empty;
     Metarace = string.Empty;
     Size = string.Empty;
     MetaraceSpecies = string.Empty;
     Age = new Age();
 }
Exemplo n.º 10
0
 public Person()
 {
     Sex = Sex.Female;
     Age = Age.ThirtyOneToForty;
     EducationLevel = EducationLevel.primary;
     Type = AgentType.Person;
     myID = idCounter++;
 }
Exemplo n.º 11
0
 public Person()
 {
     Sex = Sex.Female;
     Age = Age.ThirtyFiveToFortyFour;
     EducationLevel = EducationLevel.primary;
     HouseholdSize = HouseholdSize2.TwoPersons;
     Type = AgentType.Person;
 }
Exemplo n.º 12
0
 public Person(string currZone)
 {
     ZoneID = currZone;
     Sex = Sex.Female;
     Age = Age.ThirtyFiveToFortyFour;
     EducationLevel = EducationLevel.primary;
     HouseholdSize = HouseholdSize2.TwoPersons;
     Type = AgentType.Person;
 }
Exemplo n.º 13
0
 private Person(Person original)
 {
     Type = AgentType.Person;
     //copy the values
     ZoneID = original.ZoneID;
     Age = original.Age;
     Sex = original.Sex;
     HouseholdSize = original.HouseholdSize;
     EducationLevel = original.EducationLevel;
 }
Exemplo n.º 14
0
    public void setAge()
    {
        if(weeksOld < 15)
            age = new Child(dbManager.BuildingDB.GradeSchool);

        else if(weeksOld < 30)
            age = new Student(dbManager.BuildingDB.Undecided, new Curriculum(dbManager.BuildingDB.Undecided.GetType()));

        else
            age = new Adult(new Unemployed());
    }
Exemplo n.º 15
0
 public void setAge(Age age)
 {
     string ageString = String.Format("{0:00#}", age.Number);
     switch (age.Units)
     {
         case Age.Unit.DAYS: ageString += "D"; break;
         case Age.Unit.WEEKS: ageString += "W"; break;
         case Age.Unit.MONTHS: ageString += "M"; break;
         case Age.Unit.YEARS: ageString += "Y"; break;
     }
     base.Data = ageString;
 }
Exemplo n.º 16
0
 public Person(string currZone)
 {
     ZoneID = currZone;
     Age = Age.EighteenToTwentyFive;
     Sex = Sex.Male;
     EducationLevel = EducationLevel.primary;
     household = new Household();
     Occupation = Occupation.TradesProfessional;
     PublicTransitPass = PublicTransitPass.MetroPass;
     EmploymentStatus = EmploymentStatus.PartTime;
     DrivingLicense = DrivingLicense.No;
     Type = AgentType.Person;
     myID = idCounter++;
 }
Exemplo n.º 17
0
        public Age getAge()
        {
            Age age = new Age();
            age.Number = int.Parse(base.Data.Substring(1, 3));
            switch (base.Data.Substring(4, 1))
            {
                case "D": age.Units = Age.Unit.DAYS; break;
                case "W": age.Units = Age.Unit.WEEKS; break;
                case "M": age.Units = Age.Unit.MONTHS; break;
                case "Y": age.Units = Age.Unit.YEARS; break;
            }

            return age;
        }
Exemplo n.º 18
0
 private Person(Person original)
 {
     Type = AgentType.Person;
     //copy the values
     ZoneID = original.ZoneID;
     Age = original.Age;
     Sex = original.Sex;
     EducationLevel = original.EducationLevel;
     Occupation = original.Occupation;
     PublicTransitPass = original.PublicTransitPass;
     EmploymentStatus = original.EmploymentStatus;
     DrivingLicense = original.DrivingLicense;
     household = original.household;
     myID = idCounter++;
 }
Exemplo n.º 19
0
 public ScienceCard(
     Guid id,
     Age age,
     string title,
     string description,
     uint minimumNumberOfPlayers,
     ScienceType scienceType,
     RawMaterialResourceCost rawMaterialResourceCost,
     ManufacturedMaterialResourceCost manufacturedMaterialResourceCost,
     IEnumerable <Guid> baseCardId,
     IEnumerable <Guid> derivedCardIds)
     : base(id, age, title, description, minimumNumberOfPlayers, 0, rawMaterialResourceCost, manufacturedMaterialResourceCost, baseCardId, derivedCardIds)
 {
     this.ScienceType = scienceType;
 }
Exemplo n.º 20
0
 public MilitaryCard(
     Guid id,
     Age age,
     string title,
     string description,
     uint minimumNumberOfPlayers,
     uint militaryValue,
     RawMaterialResourceCost rawMaterialResourceCost,
     ManufacturedMaterialResourceCost manufacturedMaterialResourceCost,
     IEnumerable <Guid> baseCardId,
     IEnumerable <Guid> derivedCardIds)
     : base(id, age, title, description, minimumNumberOfPlayers, 0, rawMaterialResourceCost, manufacturedMaterialResourceCost, baseCardId, derivedCardIds)
 {
     this.MilitaryValue = militaryValue;
 }
Exemplo n.º 21
0
        private void InitializeViews(int?age_id)
        {
            Age  age;
            User user = new UsersServices().GetByUserName(User.Identity.Name.ToString());

            if (age_id != null)
            {
                age = _ageService.GetById((int)age_id);
            }
            else
            {
                age = new Age();
            }
            _ageViewModel = new AgeViewModel(age);
        }
Exemplo n.º 22
0
        //public int CompareTo(object obj)
        //{
        //    //throw new NotImplementedException();
        //    Employee other = obj as Employee;
        //    if (obj == null)
        //        throw new ArgumentException();
        //    return (Age - other.Age);
        //}

        public virtual int CompareTo(object obj)
        {
            //throw new NotImplementedException();
            if (obj != null)
            {
                Employee other = obj as Employee;
                if (other == null)
                {
                    throw new InvalidCastException();
                }
                //return (Age - other.Age);
                return(Age.CompareTo(other.Age));
            }
            throw new InvalidCastException();
        }
Exemplo n.º 23
0
        public override bool Validate()
        {
            Validator.AddRule(
                nameof(FirstName),
                () => RuleResult.Assert(
                    !string.IsNullOrWhiteSpace(FirstName),
                    $"{nameof(FirstName)} is required"
                )
            );

            Validator.AddRule(
                nameof(LastName),
                () => RuleResult.Assert(
                    !string.IsNullOrWhiteSpace(LastName),
                    $"{nameof(LastName)} is required"
                )
            );


            Validator.AddRule(
                nameof(Age),
                () => RuleResult.Assert(
                    !string.IsNullOrWhiteSpace(Age.ToString()),
                    $"{nameof(Age)} is required"
                )
            );

            Validator.AddRequiredRule(() => BirthDate, $"{nameof(BirthDate)} is required");

            Validator.AddRule(
                nameof(BirthDate),
                () => RuleResult.Assert(
                    BirthDate < DateTime.Today,
                    $"{nameof(BirthDate)} should be a valid date"));

            if (Age > 0)
            {
                Validator.AddRule(
                    nameof(Age),
                    () => RuleResult.Assert(
                        !  (Age > 121),
                        $"{nameof(Age)} is invalid"
                    )
                );
            }

            return base.Validate();
        }
        public void ShowInfo()
        {
            Console.WriteLine("\n\tINFO");

            Console.WriteLine("{0, -12}: {1, -15}", "Name", Name);
            Console.WriteLine("{0, -12}: {1, -15}", "Surname", Surname);
            Console.WriteLine("{0, -12}: {1, -15}", "Passport ID", PassportID);
            Console.WriteLine("{0, -12}: {1, -15}", "Gender", gender.ToString());
            Console.WriteLine("{0, -12}: {1, -15}", "DateBirth", date_of_birth.ToString("yyyy MMMM dd"));
            Console.WriteLine("{0, -12}: {1, -15}", "Age", Age.ToString() + " y.o");
            Console.WriteLine("{0, -12}: {1, -15}", "Weight", Weight.ToString() + " kg");
            Console.WriteLine("{0, -12}: {1, -15}", "Height", Height.ToString() + " cm\n");
            Console.WriteLine("{0, -12}: {1, -15}", "Experience", Expeience.ToString());
            Console.WriteLine("{0, -12}: {1, -15}", "Luck", Luck.ToString() + " %");
            Console.WriteLine("{0, -12}: {1, -15}", "Money", Money.ToString() + " $");
        }
Exemplo n.º 25
0
 public int CompareTo(Person other)
 {
     if (Name != other.Name)
     {
         return(Name.CompareTo(other.Name));
     }
     if (Age != other.Age)
     {
         return(Age.CompareTo(other.Age));
     }
     if (Town != other.Town)
     {
         return(Town.CompareTo(other.Town));
     }
     return(0);
 }
Exemplo n.º 26
0
        IEnumerable <ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            var results = new List <ValidationResult>();

            if (Age.ToString().Length > 3)
            {
                results.Add(new ValidationResult("Age cannot be greater than 3 digits"));
            }

            if (Phone.Length != 10)
            {
                results.Add(new ValidationResult("Phone must be 10 digits long"));
            }

            return(results);
        }
Exemplo n.º 27
0
 public GuildRewardScienceCard(
     Guid id,
     Age age,
     string title,
     string description,
     uint minimumNumberOfPlayers,
     ScienceType scienceRewardType,
     ApplicableDirection usabilityDirection,
     RawMaterialResourceCost rawMaterialResourceCost,
     ManufacturedMaterialResourceCost manufacturedMaterialResourceCost,
     IEnumerable <Guid> baseCardId,
     IEnumerable <Guid> derivedCardIds)
     : base(id, age, title, description, minimumNumberOfPlayers, usabilityDirection, rawMaterialResourceCost, manufacturedMaterialResourceCost, baseCardId, derivedCardIds)
 {
     this.ScienceRewardType = scienceRewardType;
 }
Exemplo n.º 28
0
        public bool Equals(Patient other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(FirstName == other.FirstName && LastName == other.LastName && Id == other.Id &&
                   Gender == other.Gender && Age.Equals(other.Age) && Height.Equals(other.Height) &&
                   Weight.Equals(other.Weight) && ExamDate.EqualsUpToMilliseconds(other.ExamDate));
        }
Exemplo n.º 29
0
    public void SetSurface(Age newAge, AchievementBuildingType buildingType)
    {
        if (this.m_Surface != null)
        {
            GameObject.Destroy(this.m_Surface);
        }
        string prefabName = ClientConfigConstants.Instance.GetSurfacePrefabName(buildingType, newAge);

        GameObject surfacePrefab = Resources.Load(prefabName, typeof(GameObject)) as GameObject;
        GameObject surface       = GameObject.Instantiate(surfacePrefab) as GameObject;
        Vector3    localPosition = surface.transform.position;

        surface.gameObject.transform.parent        = this.m_SurfaceParent;
        surface.gameObject.transform.localPosition = localPosition;
        this.m_Surface = surface;
    }
Exemplo n.º 30
0
 public CommerceGoldCard(
     Guid id,
     Age age,
     string title,
     string description,
     uint minimumNumberOfPlayers,
     uint goldValue,
     ApplicableDirection usabilityDirection,
     RawMaterialResourceCost rawMaterialResourceCost,
     ManufacturedMaterialResourceCost manufacturedMaterialResourceCost,
     IEnumerable <Guid> baseCardId,
     IEnumerable <Guid> derivedCardIds)
     : base(id, age, title, description, minimumNumberOfPlayers, usabilityDirection, rawMaterialResourceCost, manufacturedMaterialResourceCost, baseCardId, derivedCardIds)
 {
     this.GoldValue = goldValue;
 }
Exemplo n.º 31
0
        public override int GetHashCode()
        {
            var hashCode = 1898947492;

            hashCode = hashCode * -1521134295 + Id.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(LastName);

            hashCode = hashCode * -1521134295 + Age.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Password);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(PersonalNumber);

            return(hashCode);
        }
Exemplo n.º 32
0
        public int CompareTo(Person other)
        {
            int resultName = Name.CompareTo(other.Name);

            if (resultName == 0)
            {
                int resultAge = Age.CompareTo(other.Age);
                if (resultAge == 0)
                {
                    int resultTown = Town.CompareTo(other.Town);
                }
                return(resultAge);
            }

            return(resultName);
        }
Exemplo n.º 33
0
        public int CompareTo(Person other)
        {
            int result = Name.CompareTo(other.Name);

            if (result == 0)
            {
                result = Age.CompareTo(other.Age);

                if (result == 0)
                {
                    result = Town.CompareTo(other.Town);
                }
            }

            return(result);
        }
Exemplo n.º 34
0
        public void Bug_Trap_0_hour_bug()
        {
            ////I can't trap this bug but I know it occurs. I've seen it. Don't tell me I'm crazy! (Maybe it's old code. I've written this stuff like 4 times now.)
            var timespan = TimeSpan.FromTicks(0);

            while (timespan <= TimeSpan.FromHours(3))
            {
                string result = Age.ToRelative(timespan);
                Debug.Print(result);
                if (result.StartsWith("0"))
                {
                    Assert.Fail(String.Format("{0} ticks breaks this mofo!", timespan.Ticks));
                }
                timespan = timespan + TimeSpan.FromTicks(499923); //add less than half a second
            }
        }
Exemplo n.º 35
0
        public int CompareTo(Person other)
        {
            int cmp = Name.CompareTo(other.Name);

            if (cmp == 0)
            {
                cmp = Age.CompareTo(other.Age);

                if (cmp == 0)
                {
                    cmp = Town.CompareTo(other.Town);
                }
            }

            return(cmp);
        }
Exemplo n.º 36
0
 public bool ValidAgeFilter()
 {
     if (null != Age && Age.Trim().Length > 0)
     {
         var str = Regex.Replace(Age, @"[^0-9\-<>=]", "");
         if ((new Regex(@"^[0-9]+$|^[0-9]+\-[0-9]+$|^>=?[0-9]+$|^<=?[0-9]+$")).IsMatch(str))
         {
             return(true);
         }
         return(false);
     }
     else
     {
         return(true);
     }
 }
Exemplo n.º 37
0
        public ActionResult DisplayBirth(string dateOfbirth)
        {
            age = new Age(ConvertDate(dateOfbirth), DateTime.Today);
            StringBuilder sb = new StringBuilder();

            if (ConvertDate(dateOfbirth) > DateTime.Today)
            {
                sb.Append("Xin đừng troll em!!!!!!!!");
            }
            //sb.Append(age.Days+"/"+age.Months+"/"+age.Years+"..."+age.NextBirth(DateParsed, DateTime.Today).Days + "/" + age.NextBirth(DateParsed, DateTime.Today).Months + "/" + age.NextBirth(DateParsed, DateTime.Today).Years);
            sb.Append("Born: " + String.Format("{0:D}", ConvertDate(dateOfbirth)) +
                      "</br>Age: " + age.Years +
                      "</br>Next Birthday: " + String.Format("{0:D}", ConvertDate(age.NextBirth(ConvertDate(dateOfbirth), DateTime.Today))));
            Response.Write(sb);
            return(null);
        }
 public Schema()
     : base() {
     InstanceType = typeof(__IntegerP__);
     ClassName = "IntegerPage";
     Properties.ClearExposed();
     Html = Add<__TString__>("Html");
     Html.DefaultValue = "/KitchenSink/IntegerPage.html";
     Html.SetCustomAccessors((_p_) => { return ((__IntegerP__)_p_).__bf__Html__; }, (_p_, _v_) => { ((__IntegerP__)_p_).__bf__Html__ = (System.String)_v_; }, false);
     Age = Add<__TLong__>("Age$");
     Age.DefaultValue = 0L;
     Age.Editable = true;
     Age.SetCustomAccessors((_p_) => { return ((__IntegerP__)_p_).__bf__Age__; }, (_p_, _v_) => { ((__IntegerP__)_p_).__bf__Age__ = (System.Int64)_v_; }, false);
     AgeReaction = Add<__TString__>("AgeReaction", bind:"CalculatedAgeReaction");
     AgeReaction.DefaultValue = "";
     AgeReaction.SetCustomAccessors((_p_) => { return ((__IntegerP__)_p_).__bf__AgeReaction__; }, (_p_, _v_) => { ((__IntegerP__)_p_).__bf__AgeReaction__ = (System.String)_v_; }, false);
 }
Exemplo n.º 39
0
        public override string ToString()
        {
            string str = "\n";

            str += string.Format("{0} \t{1} \t{2} \n",
                                 StringExtensions.SpaceUppercaseLetters(Classification.ToString()),
                                 StringExtensions.SpaceUppercaseLetters(Age.ToString()),
                                 StringExtensions.SpaceUppercaseLetters(Radiation.ToString()));

            foreach (var body in CelestialBodies)
            {
                str += string.Format("{0}\n", body);
            }

            return(str);
        }
Exemplo n.º 40
0
        public void ShouldNotBe(Person other, bool sameId)
        {
            if (sameId)
            {
                Id.ShouldBe(other.Id);
            }
            else
            {
                Id.ShouldNotBe(other.Id);
            }

            Name.ShouldNotBe(other.Name);
            Age.ShouldNotBe(other.Age);
            Height.ShouldNotBe(other.Height);
            Dob.ShouldNotBe(other.Dob);
        }
    public Conditions(Creature own)
    {
        Own  = own;
        list = new List <ACondition>();
        Age age = new Age(Own);

        list.Add(age);
        Energy energy = new Energy(Own);

        list.Add(energy);
        Hunger hunger = new Hunger(Own);

        list.Add(hunger);
        Health health = new Health(Own);

        list.Add(health);
        Pregnant pregnant = new Pregnant(Own);

        list.Add(pregnant);
        //bars
        RectTransform[] arr = Own.GetComponentsInChildren <RectTransform>();
        foreach (var item in arr)
        {
            switch (item.name)
            {
            case "Health":
                health.Bar = item;
                break;

            case "Energy":
                energy.Bar = item;
                break;

            case "Hunger":
                hunger.Bar = item;
                break;

            case "Age":
                age.Bar = item;
                break;

            case "Pregnant":
                pregnant.Bar = item;
                break;
            }
        }
    }
Exemplo n.º 42
0
        /// <inheritdoc />
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            if (!string.IsNullOrEmpty(Age))
            {
                writer.AddAttribute("age", Age.ToString(CultureInfo.InvariantCulture));
            }
            if (!string.IsNullOrEmpty(Type))
            {
                writer.AddAttribute("type", Type.ToString(CultureInfo.InvariantCulture));
            }
            if (!string.IsNullOrEmpty(Location))
            {
                writer.AddAttribute("location", Location.ToString(CultureInfo.InvariantCulture));
            }

            base.AddAttributesToRender(writer);
        }
Exemplo n.º 43
0
        public int GetYearInAge()
        {
            Age temp     = Age.Generic_Age;
            int tempYear = year;

            while (tempYear > 0)
            {
                if (tempYear < ageLengths[temp])
                {
                    return(tempYear);
                }
                tempYear -= ageLengths[temp];
                temp++;
            }

            return(year);
        }
Exemplo n.º 44
0
        public FantasyDate(Age age, int year)
        {
            ageLengths = new Dictionary <Age, int>
            {
                { Age.Generic_Age, 10000 }
            };

            int extraTime = 0;
            Age temp      = Age.Generic_Age;

            while (temp != age)
            {
                extraTime += ageLengths[temp];
                temp++;
            }
            this.year = year + extraTime;
        }
Exemplo n.º 45
0
 public void TestEqualsAndHashCode()
 {
     var age1 = new Age(10, 11, 12, 13, 14, 15);
     var age2 = new Age(10, 11, 12, 13, 14, 15);
     var age3 = new Age(0, 0, 0, 0, 0, 0);
     Assert.Equal(age1, age1);
     Assert.Equal(age1, age2);
     Assert.Equal(age2, age1);
     Assert.True(age1.Equals(age1));
     Assert.True(age1.Equals(age2));
     Assert.False(age1.Equals(age3));
     Assert.False(age1.Equals(null));
     Assert.False(age1.Equals("Hello"));
     Assert.Equal(age1.GetHashCode(), age1.GetHashCode());
     Assert.Equal(age1.GetHashCode(), age2.GetHashCode());
     Assert.False(age1.GetHashCode() == age3.GetHashCode());
 }
Exemplo n.º 46
0
        public virtual void ShowInfo()
        {
            Console.WriteLine("{0, -12}: {1, -15}", "Name", Name);
            Console.WriteLine("{0, -12}: {1, -15}", "Surname", Surname);
            Console.WriteLine("{0, -12}: {1, -15}", "Passport ID", PassportID);
            Console.WriteLine("{0, -12}: {1, -15}", "Gender", gender.ToString());
            Console.WriteLine("{0, -12}: {1, -15}", "DateBirth", date_of_birth.ToString("yyyy MMMM dd"));
            Console.WriteLine("{0, -12}: {1, -15}", "Age", Age.ToString() + " y.o");
            Console.WriteLine("{0, -12}: {1, -15}", "Weight", Weight.ToString() + " kg");
            Console.WriteLine("{0, -12}: {1, -15}", "Height", Height.ToString() + " cm");

            Console.ForegroundColor = ConsoleColor.Blue;
            Console.WriteLine("{0, -12}: {1, -15}", "Experience", Experience.ToString());
            Console.WriteLine("{0, -12}: {1, -15}", "Luck", Luck.ToString() + " %");
            Console.WriteLine("{0, -12}: {1, -15}", "Money", Money.ToString() + " $");
            Console.ResetColor();
        }
Exemplo n.º 47
0
 public override bool IsContains(string text)
 {
     text = text.ToUpper();
     if (SubordinateTeachers.ToString().Contains(text) ||
         TextbooksPublished.ToString().Contains(text) ||
         AmountOfGrantsReceived.ToString().Contains(text) ||
         Name.ToUpper().Contains(text) ||
         Age.ToString().Contains(text) ||
         Sex.ToString().Contains(text))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 48
0
    public override string ToString()
    {
        // Return a string representation of the custom object
        if (m_bIsNull)
        {
            return("Student.Null");
        }
        else
        {
            string name    = (Name == null) ? "NULL" : Name;
            string address = (Address.IsNull) ? "NULL" : Address.Value;
            string age     = (Age == null) ? "NULL" : Age.ToString();
            string major   = (m_major == null) ? "NULL" : m_major;

            return("Student(" + name + ", " + address + ", " + age + ", " + major + ")");
        }
    }
Exemplo n.º 49
0
 private void ClearContent()
 {
     if (controller.PersonCount == 0)
     {
         FirstName.Clear();
         LastName.Clear();
         Age.Clear();
         TelePhoneNo.Clear();
     }
     else
     {
         FirstName.Text   = controller.CurrentPerson.FirstName;
         LastName.Text    = controller.CurrentPerson.LastName;
         Age.Text         = controller.CurrentPerson.Age.ToString();
         TelePhoneNo.Text = controller.CurrentPerson.TelephoneNo;
     }
 }
Exemplo n.º 50
0
 public void AdvanceAge()
 {
     if(currentAge == Age.CHILD)
     {
         currentAge = Age.ADULT;
         PlaySound(SimpleMusicPlayer.ADULT_TRACK_NAME);
     }
     else if(currentAge == Age.ADULT)
     {
         currentAge = Age.ELDERLY;
         PlaySound(SimpleMusicPlayer.ELDER_TRACK_NAME);
     }
     else if(currentAge == Age.ELDERLY)
     {
         currentAge = Age.CHILD;
         PlaySound(SimpleMusicPlayer.CHILD_TRACK_NAME);
     }
 }
Exemplo n.º 51
0
 public static string ComposeAgeString(Age data)
 {
     if (data != null)
     {
         string ageString = String.Format("{0:00#}", data.Number);
         switch (data.Units)
         {
             case Age.Unit.DAYS: ageString += "D"; break;
             case Age.Unit.WEEKS: ageString += "W"; break;
             case Age.Unit.MONTHS: ageString += "M"; break;
             case Age.Unit.YEARS: ageString += "Y"; break;
         }
         return ageString;
     }
     else
     {
         return string.Empty;
     }
 }
Exemplo n.º 52
0
 public static int[] GetArrayItem(Age age)
 {
     return Array[(byte)age - 1];
 }
Exemplo n.º 53
0
 public static string GetRange(Age age)
 {
     return Ranges[(byte)age - 1];
 }
Exemplo n.º 54
0
 void Awake()
 {
     age = GetComponent<Age>();
 }
Exemplo n.º 55
0
 public void SetTextures(Age.TerrainChunk chunk) {
   chunk.NormalizeTextures();
   this.td.SetAlphamaps(0, 0, chunk.textureData);
 }
Exemplo n.º 56
0
 public void SetHeights(Age.TerrainChunk chunk) { 
   this.td.SetHeights(0, 0, chunk.data);
 }
Exemplo n.º 57
0
 public void SetAge(Age curAge)
 {
     Age = curAge;
 }
Exemplo n.º 58
0
 void Awake()
 {
     moving = GetComponent<Moving>();
     aging = GetComponent<Age>();
 }
Exemplo n.º 59
0
    public AgeDto selectAgeById(String AgeId)
    {
        AgeManager mgr = new AgeManager();
        Age obj = new Age();
        obj.AgeId = AgeId;
        obj = mgr.selectAgeById(obj);

        if (obj != null)
        {
            return AgeDto.createAgeDTO(obj);
        }
        else
        {
            return null;
        }
    }
Exemplo n.º 60
0
 public void ToStringTest()
 {
     var _ = new Age(2015, 5);
     Assert.AreEqual<string>(_.ToString(), "5");
 }