コード例 #1
0
        public async Task <IActionResult> PayBolton(PayBoltonViewModel data)
        {
            try
            {
                var telOperator = TelecomOperator.GetList().SingleOrDefault(x => x.Id == data.TelecomOperatorId);
                if (telOperator == null)
                {
                    throw new Exception("TelecomOperator not found");
                }
                var simType = SimType.GetList().SingleOrDefault(x => x.Id == data.SimTypeId);
                if (simType == null)
                {
                    throw new Exception("SimType not found");
                }
                var boltonData = new TelecomeBoltonData(data.DestinationMobile, telOperator, simType, data.ProductId);
                var tokenModel = await _services.GenerateTelecomeBoltonToken(data.Amount, GenerateCallbackUrl(Request), boltonData, data.Mobile);

                return(View("Pay", tokenModel));
            }
            catch (Exception exc)
            {
                return(View("Error", new ErrorViewModel
                {
                    Message = exc.Message
                }));
            }
        }
コード例 #2
0
        public Area GetClosestAreaOfType(SimType type, Area notThisArea = null)
        {
            Area        returnValue    = null;
            List <Area> availebleAreas = new List <Area>();

            foreach (Area area in hotelArray)
            {
                if (area != null && area.Simtype == type && area != notThisArea)
                {
                    availebleAreas.Add(area);
                }
            }
            if (!IsNullOrEmpty(availebleAreas))
            {
                Dijkstra ds = new Dijkstra();
                double   shortestDistance = double.MaxValue;
                foreach (Area area in availebleAreas)
                {
                    double distance = ds.GetDistance(this.currentArea, area);
                    if (distance < shortestDistance)
                    {
                        shortestDistance = distance;
                        returnValue      = area;
                    }
                }
            }

            return(returnValue);
        }
コード例 #3
0
        private void LoadSettings()
        {
            tbProduct.Text            = mf.Products.Item(CurrentProduct).ProductName;
            VolumeUnits.SelectedIndex = mf.Products.Item(CurrentProduct).QuantityUnits;
            AreaUnits.SelectedIndex   = mf.Products.Item(CurrentProduct).CoverageUnits;
            RateSet.Text            = mf.Products.Item(CurrentProduct).RateSet.ToString("N1");
            FlowCal.Text            = mf.Products.Item(CurrentProduct).FlowCal.ToString("N1");
            TankSize.Text           = mf.Products.Item(CurrentProduct).TankSize.ToString("N0");
            ValveType.SelectedIndex = mf.Products.Item(CurrentProduct).ValveType;
            TankRemain.Text         = mf.Products.Item(CurrentProduct).CurrentTankRemaining().ToString("N0");
            tbVCN.Text    = (mf.Products.Item(CurrentProduct).VCN).ToString("G0");
            tbSend.Text   = (mf.Products.Item(CurrentProduct).SendTime).ToString("N0");
            tbWait.Text   = (mf.Products.Item(CurrentProduct).WaitTime).ToString("N0");
            tbMinPWM.Text = (mf.Products.Item(CurrentProduct).MinPWM).ToString("N0");

            tbCountsRev.Text = (mf.Products.Item(CurrentProduct).CountsRev.ToString("N0"));

            string tmp = mf.Products.Item(CurrentProduct).ModuleID.ToString();

            if (tmp == "99")
            {
                tmp = "";
            }
            tbConID.Text = tmp;

            SelectedSimulation = mf.Products.Item(CurrentProduct).SimulationType;
            switch (SelectedSimulation)
            {
            case SimType.VirtualNano:
                rbVirtual.Checked = true;
                break;

            case SimType.RealNano:
                rbReal.Checked = true;
                break;

            default:
                rbNone.Checked = true;
                break;
            }

            // VCN
            rbVCN.Checked = (mf.Products.Item(CurrentProduct).UseVCN);
            rbPID.Checked = !(mf.Products.Item(CurrentProduct).UseVCN);

            // PID
            tbPIDkp.Text     = mf.Products.Item(CurrentProduct).PIDkp.ToString("N0");
            tbPIDMinPWM.Text = mf.Products.Item(CurrentProduct).PIDminPWM.ToString("N0");
            tbPIDLowMax.Text = mf.Products.Item(CurrentProduct).PIDLowMax.ToString("N0");

            tbPIDHighMax.Text    = mf.Products.Item(CurrentProduct).PIDHighMax.ToString("N0");
            tbPIDDeadBand.Text   = mf.Products.Item(CurrentProduct).PIDdeadband.ToString("N0");
            tbPIDBrakePoint.Text = mf.Products.Item(CurrentProduct).PIDbrakepoint.ToString("N0");

            LoadSecCK();
            tbSenID.Text = mf.Products.Item(CurrentProduct).SensorID.ToString();
        }
コード例 #4
0
 private void ckSimulate_CheckedChanged(object sender, EventArgs e)
 {
     SetButtons(true);
     if (ckSimulate.Checked)
     {
         SelectedSimulation = SimType.VirtualNano;
     }
     else
     {
         SelectedSimulation = SimType.None;
     }
 }
コード例 #5
0
 public override void DrawYourself(Graphics target, SimType AreaType, int stars = 0)
 {
     if (AreaType == SimObject.SimType.Elevator)
     {
         target.DrawImage(image, location.X + 58, location.Y, image.Width, image.Height);
     }
     else
     {
         if (drawMe)
         {
             target.DrawImage(image, location.X, location.Y + 25, image.Width, image.Height);
         }
     }
 }
コード例 #6
0
        public static string GetLocalizedName(SimType type)
        {
            switch (type)
            {
            case SimType.Vampire:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.Vampire));

            case SimType.Mummy:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.Mummy));

            case SimType.SimBot:
            case SimType.Frankenstein:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.Frankenstein));

            case SimType.ImaginaryFriend:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.ImaginaryFriend));

            case SimType.Unicorn:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.Unicorn));

            case SimType.Genie:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.Genie));

            case SimType.Werewolf:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.Werewolf));

            case SimType.Fairy:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.Fairy));

            case SimType.Witch:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.Witch));

            case SimType.Mermaid:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.Mermaid));

            case SimType.Plantsim:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.PlantSim));

            case SimType.Plumbot:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.Robot));

            case SimType.TimeTraveler:
                return(OccultTypeHelper.GetLocalizedName(OccultTypes.TimeTraveler));

            default:
                return(Common.Localize("SimType:" + type));
            }
        }
コード例 #7
0
        private void RadioButtonChanged(object sender, EventArgs e)
        {
            int         Result;
            RadioButton rb = sender as RadioButton;

            if (rb != null)
            {
                if (rb.Checked)
                {
                    int.TryParse(rb.Tag.ToString(), out Result);
                    if (SelectedSimulation != (SimType)Result)
                    {
                        SetButtons(true);
                    }
                    SelectedSimulation = (SimType)Result;
                }
            }
        }
コード例 #8
0
        private void LoadSettings()
        {
            byte tempB;

            tbProduct.Text            = mf.Products.Item(CurrentProduct).ProductName;
            VolumeUnits.SelectedIndex = mf.Products.Item(CurrentProduct).QuantityUnits;
            AreaUnits.SelectedIndex   = mf.Products.Item(CurrentProduct).CoverageUnits;
            RateSet.Text            = mf.Products.Item(CurrentProduct).RateSet.ToString("N1");
            FlowCal.Text            = mf.Products.Item(CurrentProduct).FlowCal.ToString("N1");
            TankSize.Text           = mf.Products.Item(CurrentProduct).TankSize.ToString("N0");
            ValveType.SelectedIndex = mf.Products.Item(CurrentProduct).ValveType;
            cbVR.SelectedIndex      = mf.Products.Item(CurrentProduct).VariableRate;

            TankRemain.Text = mf.Products.Item(CurrentProduct).CurrentTankRemaining().ToString("N0");

            tbCountsRev.Text = (mf.Products.Item(CurrentProduct).CountsRev.ToString("N0"));

            string tmp = mf.Products.Item(CurrentProduct).ModuleID.ToString();

            if (tmp == "99")
            {
                tmp = "";
            }
            tbConID.Text = tmp;

            SelectedSimulation = mf.Products.Item(CurrentProduct).SimulationType;
            ckSimulate.Checked = (SelectedSimulation == SimType.VirtualNano);

            // PID
            tbPIDkp.Text     = mf.Products.Item(CurrentProduct).PIDkp.ToString("N0");
            tbPIDMinPWM.Text = mf.Products.Item(CurrentProduct).PIDminPWM.ToString("N0");
            tbPIDLowMax.Text = mf.Products.Item(CurrentProduct).PIDLowMax.ToString("N0");

            tbPIDHighMax.Text    = mf.Products.Item(CurrentProduct).PIDHighMax.ToString("N0");
            tbPIDDeadBand.Text   = mf.Products.Item(CurrentProduct).PIDdeadband.ToString("N0");
            tbPIDBrakePoint.Text = mf.Products.Item(CurrentProduct).PIDbrakepoint.ToString("N0");

            byte temp = mf.Products.Item(CurrentProduct).PIDTimed;

            if (temp == 0)
            {
                ckTimedResponse.Checked   = false;
                tbTimedAdjustment.Enabled = false;
                tbTimedAdjustment.Text    = "0";
            }
            else
            {
                ckTimedResponse.Checked   = true;
                tbTimedAdjustment.Enabled = true;
                tbTimedAdjustment.Text    = temp.ToString("N0");
            }

            tbSenID.Text = mf.Products.Item(CurrentProduct).SensorID.ToString();

            rbSinglePulse.Checked = !(mf.Products.Item(CurrentProduct).UseMultiPulse);
            rbMultiPulse.Checked  = (mf.Products.Item(CurrentProduct).UseMultiPulse);

            // load defaults if blank
            byte.TryParse(tbPIDkp.Text, out tempB);
            if (tempB == 0)
            {
                tbPIDkp.Text            = "50";
                tbPIDHighMax.Text       = "100";
                tbPIDBrakePoint.Text    = "20";
                tbPIDLowMax.Text        = "80";
                tbPIDMinPWM.Text        = "30";
                tbPIDDeadBand.Text      = "4";
                tbTimedAdjustment.Text  = "0";
                ckTimedResponse.Checked = false;

                SaveSettings();
            }

            tbMinUPM.Text     = mf.Products.Item(CurrentProduct).MinUPM.ToString("N1");
            ckOffRate.Checked = mf.Products.Item(CurrentProduct).UseOffRateAlarm;
            tbOffRate.Text    = mf.Products.Item(CurrentProduct).OffRateSetting.ToString("N0");
        }
コード例 #9
0
ファイル: SimObject.cs プロジェクト: hipertom/HotelSimulation
 /// <summary>
 /// Draws a simobject on the hotel
 /// </summary>
 /// <param name="target">Grapic of the hotel</param>
 /// <param name="AreaType">the type of area to draw</param>
 /// <param name="stars">(optional) number of stars to draw on a room</param>
 public abstract void DrawYourself(Graphics target, SimType AreaType, int stars = 0);
コード例 #10
0
ファイル: SimTypeScoring.cs プロジェクト: yakoder/NRaas
 public SimTypeScoring(int hit, int miss, SimType type)
     : base(hit, miss)
 {
     mType = type;
 }
コード例 #11
0
ファイル: SimTypes.cs プロジェクト: KhArtNJava/NRaas
 public static string GetLocalizedName(SimType type)
 {
     switch (type)
     {
         case SimType.Vampire:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.Vampire);
         case SimType.Mummy:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.Mummy);
         case SimType.SimBot:
         case SimType.Frankenstein:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.Frankenstein);
         case SimType.ImaginaryFriend:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.ImaginaryFriend);
         case SimType.Unicorn:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.Unicorn);
         case SimType.Genie:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.Genie);
         case SimType.Werewolf:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.Werewolf);
         case SimType.Fairy:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.Fairy);
         case SimType.Witch:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.Witch);
         case SimType.Mermaid:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.Mermaid);
         case SimType.Plantsim:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.PlantSim);
         case SimType.Plumbot:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.Robot);
         case SimType.TimeTraveler:
             return OccultTypeHelper.GetLocalizedName(OccultTypes.TimeTraveler);
         default:
             return Common.Localize("SimType:" + type);
     }
 }
コード例 #12
0
ファイル: SimTypes.cs プロジェクト: KhArtNJava/NRaas
        public static bool Matches(SimDescription sim, SimType type)
        {
            switch (type)
            {
                case SimType.MiniSim:
                    return false;
                case SimType.Dead:
                    return IsDead(sim);
                case SimType.Alive:
                    return !IsDead(sim);
                case SimType.Resident:
                    return (sim.LotHome != null);
                case SimType.Service:
                    return IsService(sim);
                case SimType.Tourist:
                    return IsTourist(sim);
                case SimType.Townie:
                    return ((sim.LotHome == null) && (!IsSpecial(sim)));
                case SimType.Mummy:
                    return sim.IsMummy;
                case SimType.SimBot:
                case SimType.Frankenstein:
                    return sim.IsFrankenstein;
                case SimType.Plumbot:
                    return sim.IsEP11Bot;
                case SimType.TimeTraveler:
                    return sim.IsTimeTraveler;
                case SimType.PlayableGhost:
                    return sim.IsPlayableGhost;
                case SimType.Pregnant:
                    return sim.IsPregnant;
                case SimType.Vampire:
                    return sim.IsVampire;
                case SimType.ImaginaryFriend:
                    return sim.IsImaginaryFriend;
                case SimType.Genie:
                    return sim.IsGenie;
                case SimType.Mermaid:
                    return sim.IsMermaid;
                case SimType.Human:
                    if (!sim.IsHuman) return false;

                    if (sim.IsPlayableGhost) return false;

                    if (sim.OccultManager == null) return true;

                    return !sim.OccultManager.HasAnyOccultType();
                case SimType.Animal:
                    return !sim.IsHuman;
                case SimType.Occult:
                    if (sim.OccultManager == null) return false;

                    return sim.OccultManager.HasAnyOccultType();
                case SimType.Werewolf:
                    return sim.IsWerewolf;
                case SimType.Fairy:
                    return sim.IsFairy;
                case SimType.Witch:
                    return sim.IsWitch;
                case SimType.Zombie:
                    return sim.IsZombie;
                case SimType.BoneHilda:
                    return sim.IsBonehilda;
                case SimType.Unicorn:
                    return sim.IsUnicorn;
                case SimType.Alien:
                    return sim.IsAlien;
                case SimType.Plantsim:
                    return sim.IsPlantSim;
                case SimType.Selectable:
                    return IsSelectable(sim);
                case SimType.NonSelectable:
                    return !IsSelectable(sim);
                case SimType.ActiveFamily:
                    return (Household.ActiveHousehold == sim.Household);
                case SimType.NonActiveFamily:
                    return (Household.ActiveHousehold != sim.Household);
                case SimType.Hybrid:
                    if (sim.OccultManager == null) return false;

                    if (sim.OccultManager.mOccultList == null) return false;

                    return (sim.OccultManager.mOccultList.Count > 1);
                case SimType.Single:
                    return (sim.Partner == null);
                case SimType.Partnered:
                    return (sim.Partner != null);
                case SimType.Steady:
                    if (sim.Partner == null) return false;

                    return !sim.IsMarried;
                case SimType.Married:
                    if (sim.Partner == null) return false;

                    return sim.IsMarried;
                case SimType.Straight:
                    if (sim.IsMale)
                    {
                        if (sim.mGenderPreferenceMale > 0) return false;

                        return (sim.mGenderPreferenceFemale > 0);
                    }
                    else
                    {
                        if (sim.mGenderPreferenceFemale > 0) return false;

                        return (sim.mGenderPreferenceMale > 0);
                    }
                case SimType.Gay:
                    if (sim.IsMale)
                    {
                        if (sim.mGenderPreferenceFemale > 0) return false;

                        return (sim.mGenderPreferenceMale > 0);
                    }
                    else
                    {
                        if (sim.mGenderPreferenceMale > 0) return false;

                        return (sim.mGenderPreferenceFemale > 0);
                    }
                case SimType.Bisexual:
                    if (sim.mGenderPreferenceMale < 0) return false;

                    return (sim.mGenderPreferenceFemale > 0);
                case SimType.Foreign:
                    return (sim.HomeWorld != GameUtils.GetCurrentWorld());
                case SimType.Local:
                    return (sim.HomeWorld == GameUtils.GetCurrentWorld());
                case SimType.StrandedCouple:
                    if (sim.Partner == null) return false;

                    return (sim.Household != sim.Partner.Household);
                case SimType.Dog:
                    return sim.IsADogSpecies;
                case SimType.Cat:
                    return sim.IsCat;
                case SimType.Horse:
                    return sim.IsHorse;
                case SimType.Deer:
                    return sim.IsDeer;
                case SimType.Raccoon:
                    return sim.IsRaccoon;
                case SimType.Role:
                    return sim.HasActiveRole;
                case SimType.WildHorse:
                    return (sim.IsHorse && sim.IsWildAnimal);
                case SimType.Stray:
                    return (!sim.IsHorse && sim.IsWildAnimal);
                case SimType.Employed:
                    return (sim.CareerManager != null && sim.CareerManager.mJob != null);
                case SimType.Unemployed:
                    return (sim.CareerManager != null && sim.CareerManager.mJob == null);
                case SimType.HasDegree:
                    try
                    {
                        // Error regarding (I believe) custom degrees and AcademicDegreeStaticData call in IsDegreeCompleted
                        if (sim.CareerManager != null && sim.CareerManager.DegreeManager != null && sim.CareerManager.DegreeManager.GetCompletedDegreeEntries().Count > 0)
                        {
                            return true;
                        }
                    }
                    catch
                    { }
                    return false;
                case SimType.Degreeless:
                    try
                    {
                        if (sim.CareerManager != null && sim.CareerManager.DegreeManager != null && sim.CareerManager.DegreeManager.GetCompletedDegreeEntries().Count == 0)
                        {
                            return true;
                        }
                    }
                    catch
                    { }
                    return false;
            }

            return false;
        }
コード例 #13
0
ファイル: SimTypes.cs プロジェクト: KhArtNJava/NRaas
        public static bool Matches(MiniSimDescription sim, SimType type)
        {
            switch(type)
            {
                case SimType.MiniSim:
                    return true;
                case SimType.Dead:
                    return IsDead(sim);
                case SimType.Alive:
                    return !IsDead(sim);
                case SimType.Service:
                    return sim.IsServicePerson;
                case SimType.Mummy:
                    return sim.IsMummy;
                case SimType.Alien:
                    return sim.IsAlien;
                case SimType.Animal:
                    return !sim.IsHuman;
                case SimType.Fairy:
                    return sim.IsFairy;
                case SimType.Frankenstein:
                case SimType.SimBot:
                    return sim.IsFrankenstein;
                case SimType.PlayableGhost:
                    return sim.IsPlayableGhost;
                case SimType.Unicorn:
                    return sim.IsUnicorn;
                case SimType.Vampire:
                    return sim.IsVampire;
                case SimType.Werewolf:
                    return sim.IsWerewolf;
                case SimType.Witch:
                    return sim.IsWitch;
                case SimType.Genie:
                    return sim.IsGenie;
                case SimType.Mermaid:
                    return sim.IsMermaid;
                case SimType.Human:
                    return sim.IsHuman;
                case SimType.Married:
                    return sim.IsMarried;
                case SimType.Partnered:
                    return sim.HasPartner;
                case SimType.Foreign:
                    return (sim.HomeWorld != GameUtils.GetCurrentWorld());
                case SimType.Local:
                    return (sim.HomeWorld == GameUtils.GetCurrentWorld());
                case SimType.Plumbot:
                    return sim.IsEP11Bot;
                case SimType.Dog:
                    return sim.IsADogSpecies;
                case SimType.Cat:
                    return sim.IsCat;
                case SimType.Horse:
                    return sim.IsHorse;
                case SimType.Deer:
                    return sim.IsDeer;
                case SimType.Raccoon:
                    return sim.IsRaccoon;
                case SimType.Role:
                    return sim.HasAssignedRole;
                case SimType.Employed:
                    return sim.JobIcon != string.Empty;
                case SimType.Unemployed:
                    return sim.JobIcon == string.Empty;
                case SimType.HasDegree:
                    return sim.mDegrees.Count > 0;
                case SimType.Degreeless:
                    return sim.mDegrees.Count == 0;
            }

            return false;
        }
コード例 #14
0
 public SimTypeTagListingOption(SimType data)
     : base(Common.Localize("SimType:" + data))
 {
     mData = data;
 }
コード例 #15
0
 public ColorPregnancyGenderSetting(SimType data)
 {
     mData = data;
 }
コード例 #16
0
 public ColorSetting(SimType data)
 {
     mData = data;
 }
コード例 #17
0
 public RelationshipStatusTagListingOption(SimType data)
     : base(Common.Localize("SimType:" + data))
 {
     mData = data;
 }
コード例 #18
0
        public static bool Matches(SimDescription sim, SimType type)
        {
            switch (type)
            {
            case SimType.MiniSim:
                return(false);

            case SimType.Dead:
                return(IsDead(sim));

            case SimType.Alive:
                return(!IsDead(sim));

            case SimType.Resident:
                return(sim.LotHome != null);

            case SimType.Service:
                return(IsService(sim));

            case SimType.Tourist:
                return(IsTourist(sim));

            case SimType.Townie:
                return((sim.LotHome == null) && (!IsSpecial(sim)));

            case SimType.Mummy:
                return(sim.IsMummy);

            case SimType.SimBot:
            case SimType.Frankenstein:
                return(sim.IsFrankenstein);

            case SimType.Plumbot:
                return(sim.IsEP11Bot);

            case SimType.TimeTraveler:
                return(sim.IsTimeTraveler);

            case SimType.PlayableGhost:
                return(sim.IsPlayableGhost);

            case SimType.Pregnant:
                return(sim.IsPregnant);

            case SimType.Vampire:
                return(sim.IsVampire);

            case SimType.ImaginaryFriend:
                return(sim.IsImaginaryFriend);

            case SimType.Genie:
                return(sim.IsGenie);

            case SimType.Mermaid:
                return(sim.IsMermaid);

            case SimType.Human:
                if (!sim.IsHuman)
                {
                    return(false);
                }

                if (sim.IsPlayableGhost)
                {
                    return(false);
                }

                if (sim.OccultManager == null)
                {
                    return(true);
                }

                return(!sim.OccultManager.HasAnyOccultType());

            case SimType.Animal:
                return(!sim.IsHuman);

            case SimType.Occult:
                if (sim.OccultManager == null)
                {
                    return(false);
                }

                return(sim.OccultManager.HasAnyOccultType());

            case SimType.Werewolf:
                return(sim.IsWerewolf);

            case SimType.Fairy:
                return(sim.IsFairy);

            case SimType.Witch:
                return(sim.IsWitch);

            case SimType.Zombie:
                return(sim.IsZombie);

            case SimType.BoneHilda:
                return(sim.IsBonehilda);

            case SimType.Unicorn:
                return(sim.IsUnicorn);

            case SimType.Alien:
                return(sim.IsAlien);

            case SimType.Plantsim:
                return(sim.IsPlantSim);

            case SimType.Selectable:
                return(IsSelectable(sim));

            case SimType.NonSelectable:
                return(!IsSelectable(sim));

            case SimType.ActiveFamily:
                return(Household.ActiveHousehold == sim.Household);

            case SimType.NonActiveFamily:
                return(Household.ActiveHousehold != sim.Household);

            case SimType.Hybrid:
                if (sim.OccultManager == null)
                {
                    return(false);
                }

                if (sim.OccultManager.mOccultList == null)
                {
                    return(false);
                }

                return(sim.OccultManager.mOccultList.Count > 1);

            case SimType.Single:
                return(sim.Partner == null);

            case SimType.Partnered:
                return(sim.Partner != null);

            case SimType.Steady:
                if (sim.Partner == null)
                {
                    return(false);
                }

                return(!sim.IsMarried);

            case SimType.Married:
                if (sim.Partner == null)
                {
                    return(false);
                }

                return(sim.IsMarried);

            case SimType.Straight:
                if (sim.IsMale)
                {
                    if (sim.mGenderPreferenceMale > 0)
                    {
                        return(false);
                    }

                    return(sim.mGenderPreferenceFemale > 0);
                }
                else
                {
                    if (sim.mGenderPreferenceFemale > 0)
                    {
                        return(false);
                    }

                    return(sim.mGenderPreferenceMale > 0);
                }

            case SimType.Gay:
                if (sim.IsMale)
                {
                    if (sim.mGenderPreferenceFemale > 0)
                    {
                        return(false);
                    }

                    return(sim.mGenderPreferenceMale > 0);
                }
                else
                {
                    if (sim.mGenderPreferenceMale > 0)
                    {
                        return(false);
                    }

                    return(sim.mGenderPreferenceFemale > 0);
                }

            case SimType.Bisexual:
                if (sim.mGenderPreferenceMale < 0)
                {
                    return(false);
                }

                return(sim.mGenderPreferenceFemale > 0);

            case SimType.Foreign:
                return(sim.HomeWorld != GameUtils.GetCurrentWorld());

            case SimType.Local:
                return(sim.HomeWorld == GameUtils.GetCurrentWorld());

            case SimType.StrandedCouple:
                if (sim.Partner == null)
                {
                    return(false);
                }

                return(sim.Household != sim.Partner.Household);

            case SimType.Dog:
                return(sim.IsADogSpecies);

            case SimType.Cat:
                return(sim.IsCat);

            case SimType.Horse:
                return(sim.IsHorse);

            case SimType.Deer:
                return(sim.IsDeer);

            case SimType.Raccoon:
                return(sim.IsRaccoon);

            case SimType.Role:
                return(sim.HasActiveRole);

            case SimType.WildHorse:
                return(sim.IsHorse && sim.IsWildAnimal);

            case SimType.Stray:
                return(!sim.IsHorse && sim.IsWildAnimal);

            case SimType.Employed:
                return(sim.CareerManager != null && sim.CareerManager.mJob != null);

            case SimType.Unemployed:
                return(sim.CareerManager != null && sim.CareerManager.mJob == null);

            case SimType.HasDegree:
                try
                {
                    // Error regarding (I believe) custom degrees and AcademicDegreeStaticData call in IsDegreeCompleted
                    if (sim.CareerManager != null && sim.CareerManager.DegreeManager != null && sim.CareerManager.DegreeManager.GetCompletedDegreeEntries().Count > 0)
                    {
                        return(true);
                    }
                }
                catch
                { }
                return(false);

            case SimType.Degreeless:
                try
                {
                    if (sim.CareerManager != null && sim.CareerManager.DegreeManager != null && sim.CareerManager.DegreeManager.GetCompletedDegreeEntries().Count == 0)
                    {
                        return(true);
                    }
                }
                catch
                { }
                return(false);
            }

            return(false);
        }
コード例 #19
0
        public static bool Matches(MiniSimDescription sim, SimType type)
        {
            switch (type)
            {
            case SimType.MiniSim:
                return(true);

            case SimType.Dead:
                return(IsDead(sim));

            case SimType.Alive:
                return(!IsDead(sim));

            case SimType.Service:
                return(sim.IsServicePerson);

            case SimType.Mummy:
                return(sim.IsMummy);

            case SimType.Alien:
                return(sim.IsAlien);

            case SimType.Animal:
                return(!sim.IsHuman);

            case SimType.Fairy:
                return(sim.IsFairy);

            case SimType.Frankenstein:
            case SimType.SimBot:
                return(sim.IsFrankenstein);

            case SimType.PlayableGhost:
                return(sim.IsPlayableGhost);

            case SimType.Unicorn:
                return(sim.IsUnicorn);

            case SimType.Vampire:
                return(sim.IsVampire);

            case SimType.Werewolf:
                return(sim.IsWerewolf);

            case SimType.Witch:
                return(sim.IsWitch);

            case SimType.Genie:
                return(sim.IsGenie);

            case SimType.Mermaid:
                return(sim.IsMermaid);

            case SimType.Human:
                return(sim.IsHuman);

            case SimType.Married:
                return(sim.IsMarried);

            case SimType.Partnered:
                return(sim.HasPartner);

            case SimType.Foreign:
                return(sim.HomeWorld != GameUtils.GetCurrentWorld());

            case SimType.Local:
                return(sim.HomeWorld == GameUtils.GetCurrentWorld());

            case SimType.Plumbot:
                return(sim.IsEP11Bot);

            case SimType.Dog:
                return(sim.IsADogSpecies);

            case SimType.Cat:
                return(sim.IsCat);

            case SimType.Horse:
                return(sim.IsHorse);

            case SimType.Deer:
                return(sim.IsDeer);

            case SimType.Raccoon:
                return(sim.IsRaccoon);

            case SimType.Role:
                return(sim.HasAssignedRole);

            case SimType.Employed:
                return(sim.JobIcon != string.Empty);

            case SimType.Unemployed:
                return(sim.JobIcon == string.Empty);

            case SimType.HasDegree:
                return(sim.mDegrees.Count > 0);

            case SimType.Degreeless:
                return(sim.mDegrees.Count == 0);
            }

            return(false);
        }
コード例 #20
0
ファイル: LodData.cs プロジェクト: domme/crest-oceanrender
        public static GameObject CreateLodData(int lodIdx, int lodCount, GameObject attachGO, float baseVertDensity, SimType simType, Dictionary <System.Type, SimSettingsBase> cachedSettings)
        {
            var go = attachGO ?? new GameObject(string.Format("{0}Cam{1}", simType.ToString(), lodIdx));

            if (attachGO == null)
            {
                // Add component if we are creating a loddata GO anew
                go.AddComponent <LodTransform>().InitLODData(lodIdx, lodCount);;
            }

            LodData sim;

            switch (simType)
            {
            case SimType.AnimatedWaves:
                sim = go.AddComponent <LodDataAnimatedWaves>();
                go.AddComponent <LodDataSeaFloorDepth>();
                go.AddComponent <ReadbackLodData>();
                break;

            case SimType.DynamicWaves:
                sim = go.AddComponent <LodDataDynamicWaves>();
                break;

            case SimType.Foam:
                sim = go.AddComponent <LodDataFoam>();
                break;

            case SimType.Flow:
                sim = go.AddComponent <LodDataFlow>();
                go.AddComponent <ReadbackLodData>();
                break;

            case SimType.Shadow:
                sim = go.AddComponent <LodDataShadow>();
                break;

            default:
                Debug.LogError("Unknown sim type: " + simType.ToString());
                return(null);
            }

            // create a shared settings object if one doesnt already exist
            SimSettingsBase settings;

            if (!cachedSettings.TryGetValue(sim.GetType(), out settings))
            {
                settings = sim.CreateDefaultSettings();
                cachedSettings.Add(sim.GetType(), settings);
            }
            sim.UseSettings(settings);

            if (attachGO == null)
            {
                // Add components if we are creating a loddata GO anew

                var cam = go.AddComponent <Camera>();
                cam.clearFlags             = sim.CamClearFlags;
                cam.backgroundColor        = new Color(0f, 0f, 0f, 0f);
                cam.cullingMask            = 0;
                cam.orthographic           = true;
                cam.nearClipPlane          = 1f;
                cam.farClipPlane           = 500f;
                cam.renderingPath          = RenderingPath.Forward;
                cam.useOcclusionCulling    = false;
                cam.allowHDR               = true;
                cam.allowMSAA              = false;
                cam.allowDynamicResolution = false;

                var cart = go.AddComponent <CreateAssignRenderTexture>();
                cart._targetName            = go.name;
                cart._width                 = cart._height = (int)(4 * baseVertDensity);
                cart._depthBits             = 0;
                cart._format                = sim.TextureFormat;
                cart._wrapMode              = TextureWrapMode.Clamp;
                cart._antiAliasing          = 1;
                cart._filterMode            = FilterMode.Bilinear;
                cart._anisoLevel            = 0;
                cart._useMipMap             = false;
                cart._createPingPongTargets = sim as LodDataPersistent != null;
                cart.Create();

                var apply = go.AddComponent <ApplyLayers>();
                apply._cullIncludeLayers = new string[] { string.Format("LodData{0}", simType.ToString()) };
            }

            return(go);
        }
コード例 #21
0
        public override void DrawYourself(Graphics target, SimType SimType, int stars = 0)
        {
            Brush color = new SolidBrush(Color.FromArgb(255, 0, 0));

            // setting background color for each room
            switch (SimType)
            {
            case SimType.Reception:
                break;

            case SimType.Room:
                color = new SolidBrush(Color.FromArgb(180, 182, 110));
                break;

            case SimType.Gym:
                color = new SolidBrush(Color.FromArgb(211, 192, 142));
                break;

            case SimType.Cinema:
                color = new SolidBrush(Color.FromArgb(21, 90, 107));
                break;

            case SimType.Pool:
                color = new SolidBrush(Color.FromArgb(223, 209, 143));
                break;

            case SimType.Restaurant:
                break;

            case SimType.Stairwell:
                break;

            case SimType.ElevatorShaft:
                break;

            default:
                break;
            }
            target.FillRectangle(color, location.X, location.Y, roomWidth * width, roomHeight * height);

            // placing tile image
            TextureBrush brush = new TextureBrush(image);

            target.FillRectangle(brush, location.X, location.Y + (roomHeight * (height - 1)), roomWidth * width, roomHeight);

            // placing door and stars on room
            if (SimType == SimType.Room)
            {
                //draw door and stars
                Image door = Resources.Door;
                Image star = Resources.star;
                int   size = 10;

                target.DrawImage(door, location.X + 25, location.Y + (roomHeight * (height - 1)) + 8);

                for (int i = 0; i < stars; i++)
                {
                    target.DrawImage(star, location.X + 70 + ((i * (size + 3))), location.Y + (roomHeight * (height - 1)) + 13, size, size);
                }
            }
        }