示例#1
0
        private Job giveCharacterJobSiteJobReturnWhetherJobFound(Character character, ref Ray rightClickRay)
        {
            Vector3?righClickedBlock = getLastSpaceAlongRay(rightClickRay);
            JobSite clickedJobSite   = getIslandManager().getJobSiteAlongRay(rightClickRay);

            if (clickedJobSite != null)
            {
                if (righClickedBlock.HasValue)
                {
                    if (Vector3.Distance((Vector3)righClickedBlock, rightClickRay.Position) < (float)clickedJobSite.intersects(rightClickRay) - .01f)
                    {
                        return(new UnemployedJob());
                    }
                }

                Job job = clickedJobSite.getJob(character, rightClickRay, new IslandWorkingProfile(
                                                    islandManager.getClosestIslandToLocation(character.getFootLocation()).getJobSiteManager(),
                                                    islandManager.getClosestIslandToLocation(character.getFootLocation()).getPathingProfile()));
                character.setJobAndCheckUseability(job);
                return(job);
            }
            return(new UnemployedJob());
        }