Example #1
0
 private void UpdateBSView(BusinessSystem bs)
 {
     TitleTextbox.Text      = bs.Title;
     VisionTextbox.Text     = bs.Vision;
     MissionTextbox.Text    = bs.Mission;
     GlobalGoalTextbox.Text = bs.GlobalGoal;
 }
        protected override EventResult OnStage(EventStage currentStage)
        {
            string potionNameLower = mPotionType.GetName().ToLower();

            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventText    = "A familiar woman approaches the counter.";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.DECIDE };
                return(EventResult.CONTINUE);

            case EventStage.DECIDE:
                EventState.currentEventText = "A familiar woman approaches the counter.";
                if (mHasPotion)
                {
                    EventState.currentEventText    = string.Format("\"Hi! I was in here last season looking for a {0} potion. Do you have any now?\"", potionNameLower);
                    EventState.currentEventOptions = new string[]
                    {
                        string.Format("Sell her a {0} potion", potionNameLower),
                        "Say no"
                    };
                    mCurrentOptionOutcomes = new EventStage[] { EventStage.ACCEPT, EventStage.REFUSE };
                }
                else
                {
                    EventState.currentEventText    = string.Format("\"Hi, I was in here last season looking for a {0} potion, and you told me to return. I still don't see any, though.\"", potionNameLower);
                    EventState.currentEventOptions = new string[]
                    {
                        "Apologize"
                    };
                    mCurrentOptionOutcomes = new EventStage[] { EventStage.UNABLE };
                }
                return(EventResult.CONTINUE);

            case EventStage.ACCEPT:
                EventState.currentEventText         = "She thanks you and pays for her potion.";
                EventState.currentEventOptions      = EventState.OK_OPTION;
                GameData.singleton.storePopularity *= 1.1f;
                BusinessSystem.SellProduct((int)mPotionType);
                break;

            case EventStage.REFUSE:
                EventState.currentEventText         = "The woman is visibly annoyed. She leaves briskly.";
                EventState.currentEventOptions      = EventState.OK_OPTION;
                GameData.singleton.storePopularity *= 0.85f; EventState.currentEventText = "\"Oh okay, I'll try again next season. Thanks!\" the woman says as she leaves.";
                break;

            case EventStage.UNABLE:
                EventState.currentEventText         = "She looks disappointed as she leaves the store empty-handed.";
                EventState.currentEventOptions      = EventState.OK_OPTION;
                GameData.singleton.storePopularity *= 0.9f;
                break;
            }
            return(EventResult.DONE);
        }
Example #3
0
        private void menuFileCreate_Click(object sender, RoutedEventArgs e)
        {
            var windowBS = new BusinessSystemEditWindow();

            if (windowBS.ShowDialog() == true)
            {
                currentBS = windowBS.BusinessSystem;
                UpdateBSView(currentBS);
                EnableUIElements();
            }
        }
Example #4
0
    private void OnBuildCompleted(Furniture furnitrue)
    {
        arrangedChairs = OwnerFloor.GetFurnitures <Chair>();
        OwnerFloor.onFurnitureListUpdate.AddListener(OnFurnitureListUpdate);

        ownerFloorBusinessSystem = OwnerFloor.GetComponent <BusinessSystem>();

        GameMode.Instance.onBusinessModeStarted.AddListener(StartSpawnCustomer);
        GameMode.Instance.onBusinessTimeOvered.AddListener(StopSpawnCustomer);

        customers = Resources.LoadAll <GameObject>("NPC/Customer");
    }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="cache"></param>
 
 /// <summary>  </summary>
 protected override void ConfigLoadAfter(IPluginConfig pluginConfig)
 {
     PolicyPrivilegeManageConfig policyPrivilegeConfig = pluginConfig as PolicyPrivilegeManageConfig;
     PrivilegeManageManager.Init(policyPrivilegeConfig.DbConfig);
     base.ConfigLoadAfter(pluginConfig);
     businessSystem = IocUnity.Get<BusinessSystem>();
     businessUser = IocUnity.Get<BusinessUser>();
     businessRole = IocUnity.Get<BusinessRole>();
     businessPrivilege = IocUnity.Get<BusinessPrivilege>();
     businessOrganization = IocUnity.Get<BusinessOrganization>();
     businessItem = IocUnity.Get<BusinessItem>();
 }
        private void OkButton_Click(object sender, RoutedEventArgs e)
        {
            BusinessSystem newBS = new BusinessSystem();

            newBS.Title      = TitleTextbox.Text;
            newBS.Vision     = VisionTextbox.Text;
            newBS.Mission    = MissionTextbox.Text;
            newBS.GlobalGoal = GlobalGoalTextbox.Text;
            BusinessSystem   = newBS;

            DialogResult = true;
            Close();
        }
Example #7
0
        static void Main(string[] args)
        {
            var bs = new BusinessSystem();

            bs.Title    = "title";
            bs.Mission  = "mission";
            bs.KeyAreas = new List <string>()
            {
                "sd", "ds"
            };
            bs.GlobalGoal = "sd";
            bs.Vision     = " vision";
            Data.DataHelper.SerializeBS(bs, "this");
            var newbs = DataHelper.DeserializeBS("this");

            Console.WriteLine(newbs.Title);
            Console.WriteLine(newbs.Vision);
            Console.ReadLine();
        }
Example #8
0
        private void menuFileLoad_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Business system (*.bs)|*.bs|All files (*.*)|*.*";
            if (openFileDialog.ShowDialog() == true)
            {
                currentBSfullPath = openFileDialog.FileName;
                try
                {
                    currentBS = DataHelper.DeserializeBS(currentBSfullPath);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Loading was unsuccessful.");
                    MessageBox.Show(ex.Message);
                    return;
                }
                UpdateBSView(currentBS);
                EnableUIElements();
            }
        }
 public BusinessSystemEditWindow(BusinessSystem bs)
 {
     InitializeComponent();
     UpdateBSView(bs);
 }
        protected override EventResult OnStage(EventStage currentStage)
        {
            switch (currentStage)
            {
            case EventStage.START:
                EventState.currentEventImage   = "faceWifeHappy";
                EventState.currentEventText    = "\"Hello again!\"";
                EventState.currentEventOptions = new string[]
                { "Welcome back!" };
                mCurrentOptionOutcomes = new EventStage[] { EventStage.S1 };
                break;

            case EventStage.S1:
                EventState.currentEventImage   = "faceWifeNeutral";
                EventState.currentEventText    = "\"Thanks for letting me observe your peacock last time. I was writing a paper on the species, and seeing it was really helpful.\"";
                EventState.currentEventOptions = EventState.CONTINUE_OPTION;
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.S2 };
                break;

            case EventStage.S2:
                EventState.currentEventImage   = "faceWifeNeutral";
                EventState.currentEventText    = "\"Would you like to go out for tea after work?\"";
                EventState.currentEventOptions = new string[] { "Sure!", "No thanks, I'm too busy." };
                mCurrentOptionOutcomes         = new EventStage[] { EventStage.ACCEPT, EventStage.REFUSE };
                break;

            case EventStage.ACCEPT:
                EventState.currentEventImage         = "faceWifeHappy";
                GameData.singleton.wifeRelationship += 10f;
                EventState.currentEventText          = "\"Awesome, I know a great place!\"\n<i>She runs off in excitement</i>";
                EventState.currentEventOptions       = EventState.OK_OPTION;
                EventState.PushEvent(new WifeEventGrowClose(), GameData.singleton.quarter + 2);     // schedule another event for next quarter
                return(EventResult.DONE);

            case EventStage.REFUSE:
                EventState.currentEventImage = "faceWifeSad";
                EventState.currentEventText  = "\"Aw, okay.\nOn an unrelated note, do you sell love potions?\"";
                if (GameData.singleton.potionsOwned[(int)PotionType.PT_LOVE_POTION] > 0)
                {
                    EventState.currentEventOptions = new string[] { "Yes" };
                    mCurrentOptionOutcomes         = new EventStage[] { EventStage.HAS_POTION };
                }
                else
                {
                    EventState.currentEventOptions = new string[] { "\"Yes, but we don't have any right now\"" };
                    mCurrentOptionOutcomes         = new EventStage[] { EventStage.NO_POTION };
                }
                break;

            case EventStage.HAS_POTION:
                EventState.currentEventImage         = "faceWifeNeutral";
                GameData.singleton.wifeRelationship += 1f;
                EventState.currentEventText          = "\"I'll buy one love potion then!\"\n<i>She pays the price and heads out.</i>";
                BusinessSystem.SellProduct((int)PotionType.PT_LOVE_POTION);
                EventState.currentEventOptions = EventState.OK_OPTION;
                EventState.PushEvent(new WifeEventLovePotion(), GameData.singleton.quarter + 1);     // schedule another event for next quarter
                return(EventResult.DONE);

            case EventStage.NO_POTION:
                EventState.currentEventImage   = "faceWifeNeutral";
                EventState.currentEventText    = "\"Alright. Well, I'll be around.\"";
                EventState.currentEventOptions = EventState.OK_OPTION;
                EventState.PushEvent(new WifeEventLovePotion(), GameData.singleton.quarter + 1);     // schedule another event for next quarter
                return(EventResult.DONE);
            }
            return(EventResult.CONTINUE);
        }
Example #11
0
 public GoalWindow(BusinessSystem businessSystem)
 {
     InitializeComponent();
     currentBS = businessSystem;
     dataGridGoalsTable.ItemsSource = Goals;
 }