/// <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(); } }
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; } }
public BPerson(SIEContext context) { _context = context; _uPerson = new UPerson(_context); _uInstitution = new UInstitution(_context); _bInstitution = new BInstitution(_context); }
private void Execute() { if (UPerson.IsThisPersonTheSelectedOne(_person)) { var a = 1; } _export = _order != null && _order.SourceBuildInfo != "Ship"; _import = _order != null && _order.SourceBuildInfo == "Ship"; }
/// <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); }
private void CheckIfCanPickUpNewOrder() { if (UPerson.IsThisPersonTheSelectedOne(_person)) { var a = 1; } if (Order1 == null || Order1.IsCompleted) { PickUpOrder(); } }
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; }
public void AddressNewAni(string newAni, bool hide) { if (UPerson.IsThisPersonTheSelectedOne(_person)) { var a = 1; } Hide();//will hide current _currentAni = newAni; SetNewPersonalObject(); AddressNewCurrentRoot(hide); }
public Structure ThereIsABetterJob(Person person) { if (person.Home == null) { return(null); } if (!UPerson.IsMajor(person.Age)) { return(BetterSchool(person)); } return(BetterWork(person)); }
private void ImportIfPossible() { if (UPerson.IsThisPersonTheSelectedOne(_person)) { var a = 1; } Execute(); if (_import) { HandleInventoriesAndOrder(); } }
/// <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); }
// 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(); }
/// <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(""); }
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 } }
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); }
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; } }
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" }); } }
/// <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(); }
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; }