Пример #1
0
    /// <summary>
    /// When at 10x, and over 100ppl may take a while for the agent get the requested path
    /// </summary>
    private void CheckIfPathPending()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        //if is waiting for a path and suppose to be movung already, then will be promt to Iddle
        if (_savedAniPathPending == "" && _agent.pathPending && _person.Body.IAmShown())
        {
            _savedAniPathPending = _person.Body.CurrentAni;
            _person.Body.TurnCurrentAniAndStartNew("isIdle");
            _startDate = null;
        }
        //once is ready will retake its ani
        else if (_savedAniPathPending != "" && !_agent.pathPending)
        {
            if (UPerson.IsThisPersonTheSelectedOne(_person))
            {
                var a = 1;
            }

            _person.Body.TurnCurrentAniAndStartNew(_savedAniPathPending);
            _savedAniPathPending = "";
            _startDate = Program.gameScene.GameTime1.CurrentDate();
        }
    }
Пример #2
0
    internal void Show()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        if (_current != null && _current.Renderer1 == null)
        {
            var gO = General.FindGameObjectInHierarchy("Geometry", _current.gameObject);
            if (gO != null)
            {
                _current.Renderer1 = gO.GetComponent <Renderer>();
            }
        }

        if (_current != null
            //&&  _current.Renderer1 != null
            )
        {
            SetScaleOfCurrent();
            //so its shown at first close to the person
            _current.UpdatePosition();
            _current.gameObject.SetActive(true);

            //_current.Renderer1.enabled = true;
        }
    }
Пример #3
0
 public BPerson(SIEContext context)
 {
     _context      = context;
     _uPerson      = new UPerson(_context);
     _uInstitution = new UInstitution(_context);
     _bInstitution = new BInstitution(_context);
 }
Пример #4
0
    private void Execute()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        _export = _order != null && _order.SourceBuildInfo != "Ship";
        _import = _order != null && _order.SourceBuildInfo == "Ship";
    }
Пример #5
0
    /// <summary>
    /// Used to loading
    /// </summary>
    /// <param name="person"></param>
    /// <param name="currAni"></param>
    public PersonalObject(Person person, string currAni, bool hide)
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        _person = person;
        Init();
        AddressNewAni(currAni, hide);
    }
Пример #6
0
    private void CheckIfCanPickUpNewOrder()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        if (Order1 == null || Order1.IsCompleted)
        {
            PickUpOrder();
        }
    }
Пример #7
0
        public PersonController(SIEContext context, IConfiguration configuration)
        {
            _bHistory          = new BHistory(context);
            _bPerson           = new BPerson(context);
            _bPasswordRecovery = new BPasswordRecovery(context, configuration);
            _bInstitution      = new BInstitution(context);
            _uPerson           = new UPerson(context);
            _uRecoveryPassword = new UPasswordRecovery(context);
            _uInstitution      = new UInstitution(context);

            _configuration = configuration;
        }
Пример #8
0
    public void AddressNewAni(string newAni, bool hide)
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        Hide();//will hide current

        _currentAni = newAni;
        SetNewPersonalObject();
        AddressNewCurrentRoot(hide);
    }
Пример #9
0
    public Structure ThereIsABetterJob(Person person)
    {
        if (person.Home == null)
        {
            return(null);
        }

        if (!UPerson.IsMajor(person.Age))
        {
            return(BetterSchool(person));
        }
        return(BetterWork(person));
    }
Пример #10
0
    private void ImportIfPossible()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        Execute();
        if (_import)
        {
            HandleInventoriesAndOrder();
        }
    }
Пример #11
0
    /// <summary>
    /// Will find adults of specific Gender from the homeless list
    /// </summary>
    /// <param name="gender">Adult gender </param>
    /// <summary>
    /// Will find adults of specific Gender from the homeless list
    /// </summary>
    /// <param name="gender">Adult gender </param>
    static private List <Person> FindAdult(H gender, List <Person> homeLessP)
    {
        List <Person> res = new List <Person>();

        for (int i = 0; i < homeLessP.Count; i++)
        {
            var person = homeLessP[i];
            if (person.Gender == gender && UPerson.IsMajor(person.Age))
            {
                res.Add(person);
            }
        }
        return(res);
    }
Пример #12
0
    // Update is called once per frame
    public void Update()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        //correcting bug where kids stay in front of storage with path completed
        if ((_destWasSet && _agent.isOnNavMesh && _agent.enabled && !_person.IsMajor
            && !UMath.nearEqualByDistance(_agent.destination, Destiny, 0.1f) &&
            _agent.pathStatus == NavMeshPathStatus.PathComplete)
            ||
            (_agent.pathStatus == NavMeshPathStatus.PathInvalid && _agent.enabled && _agent.isOnNavMesh)
            )
        {
            if (UPerson.IsThisPersonTheSelectedOne(_person))
            {
                //UVisHelp.CreateHelpers(Destiny, Root.yellowSphereHelp);
                var a = 1;
            }

            //so i set the destination again to the real one so they move towards it
            _agent.SetDestination(Destiny);
        }

        if (_nextDest != new Vector3() && !_destWasSet && _agent.isOnNavMesh && _agent.enabled)
        {
            if (UPerson.IsThisPersonTheSelectedOne(_person))
            {
                //UVisHelp.CreateHelpers(Destiny, Root.redSphereHelp);
                var a = 1;
            }

            _destWasSet = true;
            _agent.SetDestination(Destiny);
            _startDate = Program.gameScene.GameTime1.CurrentDate();
        }
        CheckIfGoingIntoBuild();
        RadiusForHeavyLoaders();

        CheckVelocity();
        CheckIfTempSpeed();
        CheckIfPathPending();

        CheckIfStuck();
    }
Пример #13
0
    /// <summary>
    /// Has the logic that defined if is a bbeter home
    /// </summary>
    /// <param name="person"></param>
    /// <returns></returns>
    private string DefineIfIsABetterHouse(Person person, string homeToEval, List <BuildRank> list)
    {
        if (ThereIsABetterHome(person, list))
        {
            var isAdult = UPerson.IsMajor(person.Age);

            if (isAdult)
            {
                return(DefineBetterHome4Adult(person, homeToEval));
            }
            else
            {
                return(DefineBetterHome4Child(person, homeToEval));
            }
        }
        return("");
    }
Пример #14
0
    internal void Walk(Vector3 point, Vector3 afterDest, Vector3 moveNowTo, HPers goingTo)
    {
        _agent.enabled = false;
        _person.transform.position = moveNowTo;

        _destWasSet = false;
        Destiny = point;
        _afterDestiny = afterDest;
        _nextDest = point;
        _agent.enabled = true;

        //Debugg(point);

        //if person is:
        //hidden
        //close enough to the destiny spawnpoint
        //destiny is a:
        //Dock
        //Library
        //Dont show
        if (_person.Body != null)
        {
            if (UPerson.IsThisPersonTheSelectedOne(_person))
            {
                var a = 1;
            }

            if (_person.Body.IsHidden() && _person.Body.IsNearBySpawnPointOfInitStructure() &&
                (_person.Body.IsDestinyOrOrigin(H.Library) || _person.Body.IsDestinyOrOrigin(H.Dock)))
            {
            }
            else
                _person.Body.Show();
        }

        if (goingTo == HPers.InWork && _person.ProfessionProp != null
            && _person.ProfessionProp.ProfDescription == Job.Builder)
        {
            _agent.obstacleAvoidanceType = ObstacleAvoidanceType.HighQualityObstacleAvoidance;
        }
        else
        {
            _agent.obstacleAvoidanceType = ObstacleAvoidanceType.LowQualityObstacleAvoidance;//low
        }
    }
Пример #15
0
    public Structure GiveWork(Person person)
    {
        var key = DecideBasedOnAge(person);
        var st  = Brain.GetStructureFromKey(key);

        //if has open positions bigger people has to Occupoied those positions bz they are for Teachers
        if (UPerson.IsWorkingAtSchool(person, st) && !UPerson.IsMajor(person.Age) && !st.HasOpenPositions())
        {
            person.IsStudent = true;
            //add to new school here
        }
        else if (UPerson.IsMajor(person.Age) && person.IsStudent)
        {
            person.IsStudent = false;
            //remove from old school here
        }
        return(st);
    }
Пример #16
0
    private void GetMeOrderIfAny(H type)
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        if (_person.Work == null || _person.Work.HType != H.Dock)
        {
            return;
        }

        var ord = _person.Work.Dispatch1.GiveMeOrderIfAny(_person, type);

        if (ord != null)
        {
            Order1            = ord;
            _person.PrevOrder = Order1;
        }
    }
Пример #17
0
        public void ListErrors(UPerson uPerson, ref List <MModelError> errors)
        {
            if (!Email.IsValidEmail())
            {
                errors.Add(new MModelError
                {
                    MessageError = "E-mail inválido!",
                    HasError     = true,
                    Property     = "Email"
                });
            }
            else if (uPerson.GetByEmail(Email) != null)
            {
                errors.Add(new MModelError
                {
                    MessageError = "E-mail já está em uso!",
                    HasError     = true,
                    Property     = "Email"
                });
            }

            if (!Cpf.ValidCpf())
            {
                errors.Add(new MModelError
                {
                    MessageError = "CPF inválido!",
                    HasError     = true,
                    Property     = "Cpf"
                });
            }

            if (!Password.IsValidPassord())
            {
                errors.Add(new MModelError
                {
                    MessageError = "A senha deve conter pelo menos 6 caracteres!",
                    HasError     = true,
                    Property     = "Password"
                });
            }
        }
Пример #18
0
    /// <summary>
    /// This Init is for Loading since the other was ReWriting loaded Values such as Order1
    /// </summary>
    private void InitForLoading()
    {
        if (UPerson.IsThisPersonTheSelectedOne(_person))
        {
            var a = 1;
        }

        //if did not load a order will return, and take a break now
        if (Order1 == null// || _destinyBuild == null
            )
        {
            _takeABreakNow = true;
            return;
        }

        _destinyBuild     = Brain.GetStructureFromKey(Order1.DestinyBuild);
        _sourceBuild      = Brain.GetStructureFromKey(Order1.SourceBuild);
        _person.PrevOrder = Order1;

        InitRoute();
    }
Пример #19
0
        public StudentController(SIEContext context, IConfiguration configuration)
        {
            _context = context;

            _bHistory = new BHistory(context);
            _bRelStudentRoom = new BRelStudentRoom(context);
            _bRoom = new BRoom(context);
            _bAnswer = new BAnswer(context);
            _bDocument = new BDocument(context);
            _bRelUploadAnswer = new BRelUploadAnswer(context);

            _uActivity = new UActivity(context);
            _uRelStudentRoom = new URelStudentRoom(context);
            _uRoom = new URoom(context);
            _uAnswer = new UAnswer(context);
            _uRelUploadActivity = new URelUploadActivity(context);
            _uRelUploadAnswer = new URelUploadAnswer(context);
            _uPerson = new UPerson(context);

            _configuration = configuration;

        }