Пример #1
0
    void Start()
    {
        localPlayerData = GlobalControl.Instance.savedPlayerData;

        // GameObject Middle = GameObject.Find ("Middle");
        // dualDemandCurve = Middle.GetComponent<MoveWith> ().dualDemandCurve;
        dualDemandCurve = localPlayerData.dualDemandCurve;


        // dualDemandCurve = Middle.GetComponent<MoveWith> ().dualDemandCurve;
        // dualDemandCurve = true; // testing only!
        destX = transform.position.x;
        destY = transform.position.y;
        destZ = transform.position.z;



        if (dualDemandCurve == true)
        {
            transform.position = new Vector3(transform.position.x + 2, transform.position.y, transform.position.z);
        }

        if (dualDemandCurve == false)
        {
            transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z);
        }
    }
Пример #2
0
    public void init()
    {
        localPlayerData = GlobalControl.Instance.savedPlayerData;
        economyStories  = new Dictionary <int, string> ();
        normalStories   = new Dictionary <int, string> ();
        initializeStories();
        econStoryRate = 0.5f;

        dayText.text = "Day " + localPlayerData.currentDay;

        ratingText.text  = "";
        restaurantRating = localPlayerData.favorabilityRating;
        while (restaurantRating > 0)
        {
            ratingText.text  += "*";
            restaurantRating -= 0.2f;
        }

        achievementNumber.text       = "\"" + localPlayerData.nextCustomerAchievementLevel.ToString() + " Customers Served\"";
        acheivementProgress          = localPlayerData.customerAchievementProgress;
        acheivementProgressRemaining = 1.0f - acheivementProgress;
        achievementText.text         = "";
        while (acheivementProgress > 0)
        {
            achievementText.text += "*";
            acheivementProgress  -= 0.1f;
        }
        while (acheivementProgressRemaining > 0)
        {
            achievementText.text         += "-";
            acheivementProgressRemaining -= 0.1f;
        }
    }
Пример #3
0
    void Start()
    {
        localPlayerData            = GlobalControl.Instance.savedPlayerData;
        localPlayerData.moneySpent = 0;         //Reset the money spent for this round

        purchaseCount = new Dictionary <string, int>();
        InitializePurchaseCount();
    }
 void Awake()
 {
     //Get the ingredientsOnHand from the global controller
     localPlayerData = GlobalControl.Instance.savedPlayerData;
     if (localPlayerData.numCustomers <= 0)
     {
         gameOver = true;
     }
 }
Пример #5
0
    void Awake()
    {
        GlobalControl gc = GlobalControl.Instance;

        print(gc.ToString());
        localPlayerData = gc.savedPlayerData;
        //Get the ingredientsOnHand from the global controller
        localPlayerData = GlobalControl.Instance.savedPlayerData;
        UpdateBalance();
    }
Пример #6
0
 /**********************************************
 * Purpose: Initialize instance of singleton
 *           Ensure it is only instance
 *           and that it will not be destroyed.
 * ********************************************/
 void Awake()
 {
     if (Instance == null)
     {
         DontDestroyOnLoad(gameObject);
         Instance        = this;
         savedPlayerData = new RestaurantStatistics();
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
    /**********************************************
    * Purpose: Initialize instance of singleton
    *           Ensure it is only instance
    *           and that it will not be destroyed.
    * ********************************************/
    void Awake()
    {
        print("GC awake.");
        if (Instance == null)
        {
            DontDestroyOnLoad(gameObject);
            Instance        = this;
            savedPlayerData = new RestaurantStatistics();
        }
        else if (Instance != this)
        {
            print("Destroying!!!!!!!!");
            Destroy(gameObject);
        }

        //Reset variables that need to be cleared each level
        allCustomersDone = false;
        phase            = 1;
        print(Instance.savedPlayerData.dishPrices ["Ham Sandwich"]);
    }
Пример #8
0
        public async Task <IActionResult> PersonalData(bool?returnUrl, bool?backUrl)
        {
            var restaurant = _session.GetInt32("restaurantsessionid");

            var _employee = _db.Employees.Find(restaurant);

            ViewBag.State = new SelectList(_db.States, "StateId", "Name");

            if (returnUrl != null && returnUrl.Value)
            {
                ViewBag.returnUrl = true;
                if (_employee != null)
                {
                    return(View(_employee.EmployeePersonalDatas.SingleOrDefault()));
                }
            }

            if (backUrl != null && backUrl.Value)
            {
                if (_employee != null)
                {
                    return(View(_employee.EmployeePersonalDatas.SingleOrDefault()));
                }
            }

            var statistics = new RestaurantStatistics();

            if (restaurant != null)
            {
                statistics.RestaurantId = restaurant;
            }

            statistics.Action      = StatisticsEnum.Registration.ToString();
            statistics.DateOccured = DateTime.Now;

            await _db.AddAsync(statistics);

            await _db.SaveChangesAsync();

            return(View());
        }
Пример #9
0
    void Start()        // removed PUBLIC not sure its purpose
    {
        localPlayerData = GlobalControl.Instance.savedPlayerData;

        // GameObject Middle = GameObject.Find ("Middle");
        // dualDemandCurve = Middle.GetComponent<MoveWith> ().dualDemandCurve;
        dualDemandCurve = localPlayerData.dualDemandCurve;

        if (dualDemandCurve == true)
        {
            localPlayerData = GlobalControl.Instance.savedPlayerData;
            // GameObject Middle = GameObject.Find ("Middle");
            // dualDemandCurve = Middle.GetComponent<MoveWith> ().dualDemandCurve;
            // dualDemandCurve = true; // testing only!
            // Main Origin to Destination Line
            lineRendererMain = GetComponent <LineRenderer> ();
            lineRendererMain.SetPosition(0, origin.position);
            lineRendererMain.SetColors(c1, c1);
            lineRendererMain.SetWidth(lineWidth, lineWidth);

            distance = Vector3.Distance(origin.position, destination.position);
        }
    }
Пример #10
0
    void Start()
    {
        localPlayerData = GlobalControl.Instance.savedPlayerData;

        //GameObject Middle = GameObject.Find ("Middle");
        // dualDemandCurve = Middle.GetComponent<MoveWith> ().dualDemandCurve;
        dualDemandCurve = localPlayerData.dualDemandCurve;


        // GameObject Middle = GameObject.Find ("Middle");
        //GameObject GhostofOrigin = GameObject.Find ("GhostofOrigin");


        // dualDemandCurve = true; // testing only!
        // GameObject GhostofOrigin = GameObject.Find ("GhostofOrigin");


        originX = transform.position.x;
        originY = transform.position.y;
        originZ = transform.position.z;

        // GhostofOrigin.GetComponent<GhostOriginScript> ().originX = originX - 2;
        // GhostofOrigin.GetComponent<GhostOriginScript> ().originY = originY;
        // GhostofOrigin.GetComponent<GhostOriginScript> ().originZ = originZ;



        if (dualDemandCurve == true)
        {
            transform.position = new Vector3(transform.position.x + 2, transform.position.y, transform.position.z);
        }

        if (dualDemandCurve == false)
        {
            transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z);
        }
    }
Пример #11
0
 // Use this for initialization
 void Awake()
 {
     localPlayerData = GlobalControl.Instance.savedPlayerData;
     UpdateSalesReport();
 }
Пример #12
0
        /// <summary>
        /// Updates the experience statistics, for the addition or removal of the given experience.
        /// </summary>
        /// <param name="experience">The experience that is being added or removed.</param>
        /// <param name="change">The change for the experience: -1 is a removal, +1 is an addition.</param>
        private void UpdateExperienceVote(Experience experience, int change)
        {
            // Get statistics object for this restaurant
            IQueryable<RestaurantStatistics> statisticsQuery = from m in dc.RestaurantStatistics
                                               where (m.RestaurantId == experience.RestaurantId)
                                               select m;

            // if there is no statistics object, creat a new one
            if (0 == statisticsQuery.Count())
            {
                RestaurantStatistics statistic = new RestaurantStatistics();
                statistic.RestaurantId = experience.RestaurantId;
                dc.RestaurantStatistics.InsertOnSubmit(statistic);
                dc.SubmitChanges();
            }

            // update restaurant statistics
            switch (experience.Satisfaction)
            {
                case 1:
                    dc.ExecuteCommand("sp_upVote @restaurantId={0}, @change={1}", new object[] { experience.RestaurantId, change });
                    break;
                case 0:
                    dc.ExecuteCommand("sp_neutralVote @restaurantId={0}, @change={1}", new object[] { experience.RestaurantId, change });
                    break;
                case -1:
                    dc.ExecuteCommand("sp_downVote @restaurantId={0}, @change={1}", new object[] { experience.RestaurantId, change });
                    break;
                default:
                    // do nothing
                    break;
            }
        }
Пример #13
0
 void Start()
 {
     //load in data from global instance
     localPlayerData = GlobalControl.Instance.savedPlayerData;
 }