Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        updateView();
        hourCount -= Time.deltaTime;
        if (Mathf.Round(hourCount) == 0)
        {
            hourCount = 3600;
            projects.hourPass();
            List <Project> projectList = projects.GetProjects();
            foreach (Project item in projectList)
            {
                if (item.Deadline == 0)
                {
                    int id = item.ID;
                    projects.RemoveProjects(id);
                    Project newProject = generateNewProject(id);
                    projects.AddProject(newProject);
                }
            }
        }

        if (workingOn != 0)
        {
            minuteCount[workingOn - 1] -= Time.deltaTime;
            if (ChangeComputer.upgrade)
            {
                minuteCount[workingOn - 1] -= Time.deltaTime;
                UnityEngine.Debug.Log("computer change");
            }
            //print(minuteCount[workingOn - 1]);
            if (Mathf.Round(minuteCount[workingOn - 1]) == 0)
            {
                minuteCount[workingOn - 1] = 1;
                int minuteLeft = projects.minutePass(workingOn);
                //print(minuteLeft);
                if (minuteLeft == 0)
                {
                    Project compProject = projects.GetProject(workingOn);
                    compProject.Completion = true;
                    int awardCurrency = compProject.Currency;
                    int awardExp      = compProject.Exp;

                    SEAttributes player = SaveSEAttributes.LoadPlayer();
                    SEAttributesController.AdjustCurrency(player, awardCurrency);

                    projects.RemoveProjects(workingOn);
                    Project newProject = generateNewProject(workingOn);
                    projects.AddProject(newProject);
                    int temp = workingOn;
                    stopProject();
                    setSceneActive(temp);
                    setPreviousSceneInactive(temp);
                }
            }
        }
    }
Esempio n. 2
0
    void initializeProjects()
    {
        projects = new ProjectList();
        Project project1 = new Project(1, 50, 50, 120);
        Project project2 = new Project(2, 10, 30, 120);
        Project project3 = new Project(3, 25, 40, 120);
        Project project4 = new Project(4, 30, 15, 120);
        Project project5 = new Project(5, 60, 45, 120);

        projects.AddProject(project1);
        projects.AddProject(project2);
        projects.AddProject(project3);
        projects.AddProject(project4);
        projects.AddProject(project5);
    }
Esempio n. 3
0
        private void ProjectAddSaveButton_Click(object sender, EventArgs e)
        {
            ProjectAddNameTextBox.Text = ProjectAddNameTextBox.Text.TrimAndRemoveWhiteSpaces().FirstLetterToUpper();

            foreach (var checkedEmployeeItem in ProjectAddcheckedListBox.CheckedItems)
            {
                CheckedOIBs.Add(checkedEmployeeItem.ToString().GetOIBInCheck());
            }

            if (ErrorCheck())
            {
                return;
            }

            AddEmployeesToProject();
            if (ErrorCheck())
            {
                return;
            }

            RemoveUncheckedEmployees();

            ProjectList.Remove(ProjectList.GetProjectByName(OldName));
            UpdateProjectName();

            ProjectList.AddProject(ProjectAddSaveButton.Text, ProjectAddDateTimeStart.Value, ProjectAddDateTimeFinisch.Value);
            Close();
        }