Example #1
0
        /// <summary>
        /// Creates a new job and adds it to the database. After adding to the database, it assigns a ID to itself.
        /// </summary>
        /// <param name="CPUNum"></param>
        /// <param name="runtime"></param>
        /// <param name="owner"></param>
        /// <param name="p"></param>
        public Job(int CPUNum, int runtime, Owner owner, Func<string, string> p)
        {
            id = 0;
            NumberOfCPU = CPUNum;
            ExpRuntime = runtime;
            Owner = owner;

            this.p = p;

            State = JobState.WAITING;

            this.id = DatabaseManager.addJob(this);

            if(runtime >= 100 && runtime <= 500)
            {
                this.type = JobType.SHORT;
            }
            else if (runtime >= 600 && runtime <= 2000)
            {
                this.type = JobType.LONG;
            }
            else if (runtime >= 2100 && runtime <= 5000)
            {
                this.type = JobType.VERY_LONG;
            }
        }
Example #2
0
	public Job  (int ID, int buildingID, JobType type)
	{
		id = ID;
		buildingRef = buildingID;
		jobType = type;
		npcRef = 123456;
	}
Example #3
0
 public void ExecuteJob(JobType jobType)
 {
     if (jobType == JobType.RecoverNow)
     {
         this.recoverNow++;
     }
 }
Example #4
0
        public bool CreateAndAddNotice(JobType type, int agentsNeeded, List<Node> whichNodes, out Notice notice)
        {
            Notice n = null;
            Int64 id = _freeID;
            _freeID++;
            switch (type)
            {
                case JobType.Attack:
                    n = new AttackJob(agentsNeeded, whichNodes, id);
                    break;
                case JobType.Disrupt:
                    n = new DisruptJob(agentsNeeded, whichNodes, id);
                    break;
                case JobType.Occupy:
                    n = new OccupyJob(agentsNeeded, whichNodes, id);
                    break;
                case JobType.Repair:
                    n = new RepairJob(whichNodes, id);
                    break;
            }
            if (n == null)
                throw new ArgumentException("Input to CreateNotice, JoType : " + type.GetType().Name + " was not of appropriate type. It's type was: " + type.GetType());

            bool b = AddNotice(n);
            notice = n;

            return b;
        }
Example #5
0
 public string QueueJob(string storeId, JobType jobType, string jobData, DateTime? scheduledRunTime)
 {
     string jobId = Guid.NewGuid().ToString("N");
     using (var conn = new SqlConnection(_connectionString))
     {
         conn.Open();
         try
         {
             using (var cmd = conn.CreateCommand())
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.CommandText = "Brightstar_QueueJob";
                 cmd.Parameters.AddWithValue("id", jobId);
                 cmd.Parameters.AddWithValue("storeId", storeId);
                 cmd.Parameters.AddWithValue("jobType", (short) jobType);
                 cmd.Parameters.AddWithValue("jobData", jobData);
                 cmd.Parameters.AddWithValue("scheduledRunTime",
                                             scheduledRunTime.HasValue
                                                 ? (object) scheduledRunTime.Value
                                                 : DBNull.Value);
                 var rowCount = cmd.ExecuteNonQuery();
                 if (rowCount == 1) return jobId;
             }
         }
         finally
         {
             conn.Close();
         }
     }
     return null;
 }
Example #6
0
        public void AddChar(uint charID, string charName, RaceType charRace, uint cExp, JobType job, byte pendingDeletion)
        {
            this.numberOfChars++;

            byte[] tempdata = new byte[this.data.Length + 47];

            this.data.CopyTo(tempdata, 0);
            this.data = tempdata;
            int currentPos = 40;

            this.PutByte(this.numberOfChars, (ushort)currentPos);

            currentPos = 41 + ((this.numberOfChars - 1) * 46);

            this.PutUInt(charID, (ushort)currentPos);

            if (charName.Length > 16) charName = Global.SetStringLength(charName, 16);
            this.PutString(charName, (ushort)(currentPos + 4));

            this.PutByte((byte)charRace, (ushort)(currentPos + 4 + 34));

            this.PutUInt(cExp, (ushort)(currentPos + 4 + 34 + 1));

            this.PutByte((byte)job, (ushort)(currentPos + 4 + 34 + 1 + 4));

            this.PutByte(pendingDeletion, (ushort)(currentPos + 4 + 34 + 1 + 4 + 1));
        }
Example #7
0
        private static void WalkJobTypeRet(XmlNode JobTypeRet)
        {
            if (JobTypeRet == null) return;

            JobType jt = null;
            RotoTrackDb db = new RotoTrackDb();

            string ListID = JobTypeRet.SelectSingleNode("./ListID").InnerText;
            if (db.JobTypes.Any(f => f.QBListId == ListID))
            {
                jt = db.JobTypes.First(f => f.QBListId == ListID);
            }
            else
            {
                jt = new JobType();
                db.JobTypes.Add(jt);
            }
            jt.QBListId = ListID;

            string Name = JobTypeRet.SelectSingleNode("./Name").InnerText;
            jt.Name = Name;

            string IsActive = "false";
            if (JobTypeRet.SelectSingleNode("./IsActive") != null)
            {
                IsActive = JobTypeRet.SelectSingleNode("./IsActive").InnerText;
            }
            jt.IsActive = (IsActive == "true") ? true : false;

            if (jt != null)
            {
                db.SaveChanges();
            }
        }
        public static GenotypingViewModel Create(IRepositoryFactory repositoryFactory, User user, JobType jobType = null, GenotypingPostModel postModel = null)
        {
            var viewModel = new GenotypingViewModel()
                {
                    JobType = jobType,
                    JobTypes = jobType == null ? repositoryFactory.JobTypeRepository.Queryable.Where(a => a.Genotyping).ToList() : new List<JobType>(),
                    PostModel = postModel ?? new GenotypingPostModel() {NumPlates = 1}
                };

            if (jobType != null)
            {
                var rid = postModel != null && postModel.RechargeAccount != null ? postModel.RechargeAccount.Id : -1;
                viewModel.RechargeAccounts = new SelectList(user.RechargeAccounts, "Id", "AccountNum", rid);

                var pts = new List<SelectListItem>();
                pts.Add(new SelectListItem() { Value = ((int)Core.Resources.PlateTypes.NinetySix).ToString(), Text = EnumUtility.GetEnumDescription(Core.Resources.PlateTypes.NinetySix) });
                pts.Add(new SelectListItem() { Value = ((int)Core.Resources.PlateTypes.ThreeEightyFour).ToString(), Text = EnumUtility.GetEnumDescription(Core.Resources.PlateTypes.ThreeEightyFour) });
                viewModel.PlateTypes = new SelectList(pts, "Value", "Text");

                var did = postModel != null && postModel.Dyes != null ? postModel.Dyes : new List<int>();
                viewModel.Dyes = new MultiSelectList(repositoryFactory.DyeRepository.Queryable.Where(a => a.Genotyping), "Id", "Name", did);
            }

            return viewModel;
        }
Example #9
0
 public RunJobRequest(string  executionEngineIp, int executionEnginePort, int jobId, JobType jobType, IList<string> testcases)
 {
     Type = Request.RUNJOB;
     ExecutionEngineIp = executionEngineIp;
     ExecutionEnginePort = executionEnginePort;
     JobId = jobId;
     JobType = jobType;
     TestCasesToRun = testcases;
 }
Example #10
0
        public void ExecuteJob(JobType jobType)
        {
            if (this.jobs.ContainsKey(jobType))
            {
                this.jobs.Add(jobType, 0);
            }

            this.jobs[jobType] += 1;
        }
Example #11
0
 private static ushort GetJobSPBonus(JobType job)
 {
     switch (job)
     {
         case JobType.ENCHANTER:
             return 0;
         default :
             return 0;
     }
 }
Example #12
0
 public Employee(string name, string firstName, string email, string address, string city, string postalCode,
     Gender gender, JobType jobType, DateTime startedWorking, String nationalRegistryNumber)
     : base(name, firstName, email, address, city, postalCode)
 {
     Gender = gender;
     JobType = jobType;
     StartedWorking = startedWorking;
     NationalRegistryNumber = nationalRegistryNumber;
     SetEmployeeNumber();
 }
Example #13
0
File: Gear.cs Project: DuCNiKo/SWUM
 public Gear(GearType gearType, JobType job, GearState state, GearElementary elementary, TierType tier, LevelType level)
     : base (ItemType.Gear, tier, level)
 {
     if (gearType == GearType.Undefined) throw new ArgumentException("The gear type is undefined.", nameof(gearType));
     if (job == JobType.Undefined) throw new ArgumentException("The job is undefined.", nameof(job));
     if (state == GearState.Undefined) throw new ArgumentException("The gear state is undefined.", nameof(state));
     Elementary = elementary;
     State = state;
     GearType = gearType;
     Job = job;
 }
Example #14
0
 private static short GetJobHPBonus(JobType job)
 {
     switch (job)
     {
         case JobType.ENCHANTER :
             return 0;
         case JobType.SWORDMAN :
             return 0;
     }
     return 0;
 }
Example #15
0
 // TODO:  This is hard-coded for Purse Seine crew, something that needs fixing...
 // Probably the best fix would be to centralize crew into a common table
 // and enforce jobtype constraints at the application level.
 public static Crew AsCrew(this TubsWeb.ViewModels.CrewViewModel.CrewMemberModel cmm, JobType job)
 {
     Crew crew = null;
     if (null != cmm && !cmm._destroy && cmm.IsFilled)
     {
         crew = new PurseSeineCrew();
         cmm.CopyTo(crew);
         if (!crew.Job.HasValue)
             crew.Job = job;
     }
     return crew;
 }
Example #16
0
        //Generic job dispatcher routine
        static object DispatchJob(JobType type, params object[] args)
        {
            bool result;

            Job job = JobLoader.GetJob(type);

            result = job.Perform(args);

            if (!string.IsNullOrEmpty(job.ResultMessage))
                Program.LoadForm(new MessageForm(job.ResultMessage, job.Name, result ? MessageForm.MessageType.Info : MessageForm.MessageType.Error));

            return job.Result;
        }
Example #17
0
 public static Job GetJob(JobType type)
 {
     switch (type)
     {
         case JobType.Install:
             return new Installation();
         case JobType.Uninstall:
             return new Uninstallation();
         case JobType.MagnetPerform:
             return new MagnetJob();
         case JobType.AddService:
             return new AddNewService();
         default:
             throw new Exception("Geçersiz iş nesnesi");
     }
 }
Example #18
0
        /// <summary>
        /// Create a new entity, naked and squirming
        /// Created with no equipment, knowledge, family, etc
        /// </summary>
        /// <param name="template"></param>
        /// <param name="needs"></param>
        /// <param name="level"></param>
        /// <param name="job"></param>
        /// <param name="sex"></param>
        /// <param name="sexuality"></param>
        /// <param name="position"></param>
        /// <param name="icons"></param>
        /// <param name="world"></param>
        public Entity(EntityTemplate template, Dictionary <NeedIndex, EntityNeed> needs, int level, JobType job, Sex sex, Sexuality sexuality,
                      Vector2Int position, List <Sprite> sprites, WorldInstance world) :
            base(NameProvider.GetRandomName(template.CreatureType, sex), template.Statistics[StatisticIndex.Endurance].Value * 2, position, sprites, template.JoyType, true)
        {
            this.CreatureType = template.CreatureType;

            this.m_Size = template.Size;
            this.Slots  = template.Slots;

            this.m_JobLevels       = new Dictionary <string, int>();
            this.m_Sexuality       = sexuality;
            this.m_IdentifiedItems = new List <string>();
            this.m_Statistics      = template.Statistics;

            if (template.Skills.Count == 0)
            {
                this.m_Skills = EntitySkillHandler.GetSkillBlock(needs);
            }
            else
            {
                this.m_Skills = template.Skills;
            }
            this.m_Needs     = needs;
            this.m_Abilities = template.Abilities;
            this.m_Level     = level;
            for (int i = 1; i < level; i++)
            {
                this.LevelUp();
            }
            this.m_Experience     = 0;
            this.m_CurrentJob     = job;
            this.m_Sentient       = template.Sentient;
            this.m_NaturalWeapons = NaturalWeaponHelper.MakeNaturalWeapon(template.Size);
            this.m_Equipment      = new Dictionary <string, ItemInstance>();
            this.m_Backpack       = new List <ItemInstance>();
            this.m_Relationships  = new Dictionary <long, int>();
            this.Sex          = sex;
            this.m_Family     = new Dictionary <long, RelationshipStatus>();
            this.m_VisionType = template.VisionType;

            this.m_Tileset = template.Tileset;

            this.CalculateDerivatives();

            this.m_Vision = new bool[1, 1];

            this.m_Pathfinder      = new Pathfinder();
            this.m_PathfindingData = new Queue <Vector2Int>();

            this.m_FulfillingNeed    = (NeedIndex)(-1);
            this.m_FulfilmentCounter = 0;

            this.RegenTicker = RNG.Roll(0, REGEN_TICK_TIME - 1);

            this.MyWorld = world;

            SetFOVHandler();
            SetCurrentTarget();
        }
Example #19
0
        public async Task CreateJobType(JobType jobType)
        {
            await _context.JobTypes.AddAsync(jobType);

            await _context.SaveChangesAsync();
        }
Example #20
0
    public static void RespawnPlayer(NetworkConnection conn, short playerControllerId, JobType jobType)
    {
        GameObject player          = CreatePlayer(jobType);
        var        connectedPlayer = PlayerList.Instance.UpdatePlayer(conn, player);

        NetworkServer.ReplacePlayerForConnection(conn, player, playerControllerId);
        TriggerEventMessage.Send(player, EVENT.PlayerSpawned);
        if (connectedPlayer.Script.PlayerSync != null)
        {
            connectedPlayer.Script.PlayerSync.NotifyPlayers(true);
        }
    }
Example #21
0
 public static IntPtr Initialize(JobType jobType)
 {
     return(JobsUtility.CreateJobReflectionData(typeof(JobStruct_Process1 <T, U0>), typeof(T), jobType, (ExecuteJobFunction)Execute));
 }
        public static void RegisterJobCommand(string commandName, Action <Command> commandFunc, JobType requiredLevel, bool skipDutyCheck = false)
        {
            var jobTypes = Enum.GetValues(typeof(JobType)).Cast <JobType>().ToList();

            jobTypes.ForEach(o =>
            {
                if (requiredLevel.ToString().Contains(o.ToString()))
                {
                    var dutyFunc = new Action <Command>(cmd =>
                    {
                        if (Server.Server.Instance.Get <JobHandler>().OnDutyAs(cmd.Session, requiredLevel) || skipDutyCheck)
                        {
                            commandFunc(cmd);
                        }
                    });
                    ACEWrappers.CreateRestrictedCommand(commandName, dutyFunc, o, true);
                }
            });
        }
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            var parentCode = filterContext.RouteData.Values["controller"].ToString().ToLower();
            var childCode  = filterContext.RouteData.Values["smallcategory"].ToString().ToLower();

            if (childCode == "chengren")//暂时禁用chengren
            {
                childCode = "shouji";
            }
            string region = null;

            if (filterContext.RouteData.Values.ContainsKey("region"))
            {
                region = filterContext.RouteData.Values["region"].ToString().ToLower();
            }

            string circle = null;

            if (filterContext.RouteData.Values.ContainsKey("circle"))
            {
                circle = filterContext.RouteData.Values["circle"].ToString().ToLower();
            }

            YellowPageBigType BigType;

            //if (Enum.TryParse<YellowPageBigType>(parentCode, true, out BigType))//黄页
            if (parentCode.TryParse <YellowPageBigType>(true, out BigType))//黄页
            {
                YellowPageType SmallType = (YellowPageType)Enum.Parse(typeof(YellowPageType), childCode, true);
                filterContext.Controller.ViewData["category"] = InfoCategory.GetCategory(SmallType);
            }
            else if (parentCode == "zhaopin" //全职招聘
                                             //|| parentCode == "jianli"//全职简历
                     || parentCode == "qiuzhi" ||//全职简历
                     parentCode == "zhaopinjz" ||//兼职招聘
                     parentCode == "qiuzhijz"//兼职简历
                     )
            {
                JobType jobType = (JobType)Enum.Parse(typeof(JobType), childCode, true);
                filterContext.Controller.ViewData["category"] = InfoCategory.GetCategory(jobType);
            }
            else if (parentCode == "zhaopinhui")//招聘会
            {
            }
            else
            {
                InfoCategory parentCategory = null;
                foreach (var category in InfoCategory.Categories)
                {
                    if (category.Code != null && category.Code.ToLower() == parentCode)
                    {
                        parentCategory = category;
                        break;
                    }
                }
                var categories = parentCategory.Children;
                filterContext.Controller.ViewData["category"] = categories.First(item => item.Code != null && item.Code.ToLower() == childCode);
            }

            if (region != null)
            {
                filterContext.Controller.ViewData["Region"] = Region.GetRegion(Convert.ToInt16(region));
            }
            else
            {
                filterContext.Controller.ViewData["Region"] = null;
            }
            filterContext.Controller.ViewData["ParentCode"] = parentCode;
            filterContext.Controller.ViewData["ChildCode"]  = childCode;
            if (circle != null)
            {
                filterContext.Controller.ViewData["Circle"] = Circle.GetCircle(Convert.ToInt16(circle));
            }
            base.OnActionExecuting(filterContext);
        }
Example #24
0
        /// <summary>
        /// <para>Performs the search method:
        /// Search Jobs.
        /// </para><para>
        /// Creates a query string using the parameters provided - parameters can be null if they are not required for the request.
        /// </para>
        /// DOES NOT REQUIRE AUTHENTICATION.
        /// </summary>
        /// <param name="searchString">One or more keywords to use in a search query.</param>
        /// <param name="sortOrder">Sort the returned record-set by a single specified sort order.</param>
        /// <param name="salaryMin">Minimum salary.</param>
        /// <param name="salaryMax">Maximum salary.</param>
        /// <param name="region">Job offer region.</param>
        /// <param name="district">Job offer district.</param>
        /// <param name="type">Type of position.</param>
        /// <param name="category">Category.</param>
        /// <param name="subcategory">Subcategory.</param>
        /// <param name="page">Page number.</param>
        /// <param name="rows">Number of rows per page.</param>
        /// <returns>Jobs.</returns>
        public Jobs SearchJobs(
            string searchString,
            SortOrder sortOrder,
            decimal salaryMin,
            decimal salaryMax,
            string region,
            string district,
            JobType type,
            string category,
            string subcategory,
            int? page,
            int? rows)
        {
            if (_search == null)
            {
                _search = new SearchMethods(_connection);
            }

            return _search.SearchJobs(searchString, sortOrder, salaryMin, salaryMax, region, district, type, category, subcategory, page, rows);
        }
Example #25
0
    /// <summary>
    /// 職業を設定する。
    /// @changed m_yamada
    /// </summary>
    /// <param name="nextIndex"></param>
    public void SetSelectJobType(ref int selectedNum)
    {
        if (selectedNum < 0)
        {
            selectedNum = JobTypeCount - 1;
        }
        else if (selectedNum >= JobTypeCount)
        {
            selectedNum = 0;
        }

        SelectedJobType = GetJobDataFindArray(selectedNum).jobType;
        jobSelectType.text = SelectedJobType.ToString();
    }
Example #26
0
 /// <summary>
 /// 職業データID検索編
 /// </summary>
 /// <param name="jobID">職業のID</param>
 /// <returns>職業データ</returns>
 public JobData GetJobDataFindJobId(JobType jobType)
 {
     return JobDataBase.Find(job => job.jobType == jobType);
 }
Example #27
0
 public void UpdateJobLevel(ActorPC pc, JobType type, byte level)
 {
 }
Example #28
0
 public void NewJobLevel(ActorPC pc, JobType type, byte level)
 {
 }
Example #29
0
 public void DeleteJobLevel(ActorPC pc, JobType type)
 {
 }
        public List<Job> GetJobsByExecutionDay(string groupName, DateTime? dateTime, JobType jobType)
        {
            var jobsList = new List<Job>();

            if (jobType == JobType.Manual)
            {
                jobsList.Add(new SqlJob  { JobId = 12, IsFavorite = true, ExecutionDays = 1, Group = "Replicación", Name = "Job Replicación 1", JobType = JobType.Manual, LastExecutionStatus = LastExecutionStatus.Error});
                jobsList.Add(new SqlJob  { JobId = 23, IsFavorite = true, ExecutionDays = 2, Group = "Replicación", Name = "Job Replicación 2", JobType = JobType.Manual, LastExecutionStatus =LastExecutionStatus.Error });
                jobsList.Add(new SqlJob  { JobId = 45, IsFavorite = true, ExecutionDays = 8, Group = "Replicación", Name = "Job Replicación 4", JobType = JobType.Manual, LastExecutionStatus  = LastExecutionStatus.Error });
            }
            else
            {
                jobsList.Add(new SqlJob  { JobId = 12, IsFavorite = true, ExecutionDays = 1, Group = "Replicación", Name = "Job Replicación 1", JobType = JobType.Automatico, LastExecutionStatus = LastExecutionStatus.Error});
                jobsList.Add(new SqlJob  { JobId = 23, IsFavorite = true, ExecutionDays = 2, Group = "Replicación", Name = "Job Replicación 2", JobType = JobType.Automatico, LastExecutionStatus =LastExecutionStatus.Error });
                jobsList.Add(new SqlJob  { JobId = 45, IsFavorite = true, ExecutionDays = 8, Group = "Replicación", Name = "Job Replicación 4", JobType = JobType.Automatico, LastExecutionStatus  = LastExecutionStatus.Error });
            }

            return jobsList;
        }
    public void RequestJob(JobType job)
    {
        var jsonCharSettings = JsonConvert.SerializeObject(PlayerManager.CurrentCharacterSettings);

        CmdRequestJob(job, jsonCharSettings);
    }
Example #32
0
 /// <summary>
 /// 職業データ
 /// </summary>
 /// <param name="job">職業</param>
 /// 職業のデータが増えるのであれば以下に追加してください
 /// 例)職業の説明など
 public JobData(GameObject job, JobType jobType)
 {
     this.job = job;
     this.jobType = jobType;
 }
        public List<JobTrigger> GetJobTriggersByExecutionDay(DateTime? dateTime, JobType jobType)
        {
            var jobsTriggerList = new List<JobTrigger>();

            var sqlJob = new SqlJob
            {
                JobId = 12,
                IsFavorite = true,
                ExecutionDays = 1,
                Group = "Replicación",
                Name = "Job Replicación 1",
                JobType = jobType
            };

            jobsTriggerList.Add(new SqlJobTrigger { JobTriggerId = 1, Job = sqlJob, RecordsAffected = 1, RecordsProcessed = 100, JobTriggerStatus = JobTriggerStatus.Agendado });
            jobsTriggerList.Add(new SqlJobTrigger { JobTriggerId = 2, Job = sqlJob, RecordsAffected = 2, RecordsProcessed = 200, JobTriggerStatus = JobTriggerStatus.Agendado });

            return jobsTriggerList;
        }
Example #34
0
 public int GetOccupationMaxCount(JobType jobType)
 {
     return(OccupationList.Instance.Get(jobType).Limit);
 }
Example #35
0
        private static bool OptionIsValid(DialogueOption option, SpeciesType species, JobType job, Required required)
        {
            var speciesIsValid  = option.species == SpeciesType.None || option.species == species;
            var jobIsValid      = option.job == JobType.None || option.job == job;
            var requiredIsValid = option.required == Required.None || option.required == required;

            return(speciesIsValid && jobIsValid && requiredIsValid);
        }
 public JobProgressUpdateEventArgs(long jobId, JobType jobType, JobState jobState, int progressPercentage) : base(jobId, jobType, jobState)
 {
     ProgressPercentage = progressPercentage;
 }
        public override string ToString()
        {
            string jobData = "\n";

            for (int i = 0; i < 6; i++)
            {
                if (i == 0)
                {
                    if (!String.IsNullOrEmpty(Id.ToString()))
                    {
                        jobData = jobData + "ID: " + Id.ToString() + "\n";
                    }
                    else
                    {
                        jobData = jobData + "ID: Data not available" + "\n";
                    }
                }
                else if (i == 1)
                {
                    if (!String.IsNullOrEmpty(Name))
                    {
                        jobData = jobData + "Name: " + Name + "\n";
                    }
                    else
                    {
                        jobData = jobData + "Name: Data not available" + "\n";
                    }
                }
                else if (i == 2)
                {
                    if (!String.IsNullOrEmpty(EmployerName.ToString()))
                    {
                        jobData = jobData + "Employer: " + EmployerName.ToString() + "\n";
                    }
                    else
                    {
                        jobData = jobData + "Employer: Data not available" + "\n";
                    }
                }
                else if (i == 3)
                {
                    if (!String.IsNullOrEmpty(EmployerLocation.ToString()))
                    {
                        jobData = jobData + "Location: " + EmployerLocation.ToString() + "\n";
                    }
                    else
                    {
                        jobData = jobData + "Location: Data not available" + "\n";
                    }
                }
                else if (i == 4)
                {
                    if (!String.IsNullOrEmpty(JobType.ToString()))
                    {
                        jobData = jobData + "Position Type: " + JobType.ToString() + "\n";
                    }
                    else
                    {
                        jobData = jobData + "Position Type: Data not available" + "\n";
                    }
                }
                else if (i == 5)
                {
                    if (!String.IsNullOrEmpty(JobCoreCompetency.ToString()))
                    {
                        jobData = jobData + "Core Competency: " + JobCoreCompetency.ToString() + "\n";
                    }
                    else
                    {
                        jobData = jobData + "Core Competency: Data not available" + "\n";
                    }
                }
            }

            return(jobData);
        }
Example #38
0
        /// <summary>
        /// Добавить воркер
        /// </summary>
        /// <param name="strWorkerName">Внутреннее имя, просто для удобства</param>
        /// <param name="strPattern">Паттерн-тригер, это может быть как подстрока, так и wildcard-маска или regex-выражение</param>
        /// <param name="socketWorkerFunction">Имя воркера</param>
        /// <param name="socketWorkerEntryType">Способ анализа для проверки условий вызова</param>
        /// <param name="socketWorkerEntryAnalysisType">Тип анализа - подстрока, так и wildcard-маска или regex-выражение</param>
        /// <param name="socketWorkerJobType">Что планируется делать, пока что это не сильно важно но, думаю, потом пригодитя для пре или пост работы с потоком соединения или какими-нибудь буфферами. В общем, TODO</param>
        public void Add(string strWorkerName, string strPattern, SocketWorkerFunction socketWorkerFunction = null, EntryType socketWorkerEntryType = EntryType.Command, Strings.EqualAnalysisType socketWorkerEntryAnalysisType = Strings.EqualAnalysisType.Strong, JobType socketWorkerJobType = JobType.SendText)
        {
            if (String.IsNullOrEmpty(strWorkerName) && String.IsNullOrEmpty(strPattern))
            {
                throw new ArgumentNullException();
            }

            var _item = new SocketWorkerItem
            {
                strEntryPointPattern          = strPattern,
                SocketWorkerEntryType         = socketWorkerEntryType,
                SocketWorkerEntryAnalysisType = socketWorkerEntryAnalysisType,
                SocketWorkerJobType           = socketWorkerJobType,
                SocketWorkerFunction          = socketWorkerFunction
            };

            if (socketWorkerFunction == null)
            {
                LogFile.Debug("Null function for SocketWorker named '" + strWorkerName + "' with pattern '" + strPattern + "'");
                _item.SocketWorkerFunction = EmptyWorker;
            }

            Items.Add(strWorkerName, _item);
        }
Example #39
0
 public void SetJob(JobType job)
 {
     this.PutByte((byte)job, 8);
 }
Example #40
0
        protected Job(JObject json)
        {
            if (json == null) throw new ArgumentNullException("json");

            _readOnly = true;

            _autoApprove = json.Value<string>("auto_approve") == "1";
            _force = json.Value<string>("force") == "1";

            _body = json.Value<string>("body_src");
            _comment = json.Value<string>("comment");
            _customData = json.Value<string>("custom_data");

            _slug = json.Value<string>("slug");
            _sourceLang = json.Value<string>("lc_src");
            _targetLang = json.Value<string>("lc_tgt");

            if (json.SelectToken("max_chars") != null)
            {
                _maximumCharacters = json.Value<int>("max_chars");
            }

            _type = json.Value<string>("type").ToJobType();
            _tier = json.Value<string>("tier").ToTranslationTier();

            var callback = json.Value<string>("callback_url");

            Uri.TryCreate(callback, UriKind.Absolute, out _callbackUrl);

            var fileUrl = json.Value<string>("tgt_file_link");
            Uri.TryCreate(fileUrl, UriKind.Absolute, out _fileUrl);
        }
Example #41
0
 internal BwArguments(JobType type, string id)
 {
     this.Type = type;
     this.ID   = id;
 }
Example #42
0
 /// Good looking job name
 public static string JobString(this JobType job)
 {
     return(job.ToString().Equals("NULL") ? "*just joined" : textInfo.ToTitleCase(job.ToString().ToLower()).Replace("_", " "));
 }
Example #43
0
    public static void SpawnViewer(NetworkConnection conn, short playerControllerId, JobType jobType = JobType.NULL)
    {
        GameObject joinedViewer = Object.Instantiate(networkManager.playerPrefab);

        NetworkServer.AddPlayerForConnection(conn, joinedViewer, 0);
    }
Example #44
0
        public virtual IEnumerable <VisitorSegment> ParseContacts(JToken definition, JobType type)
        {
            var segments = new List <VisitorSegment>();

            if (JobType.Contacts != type)
            {
                return(segments);
            }

            foreach (var contact in (JArray)definition)
            {
                if (contact["interactions"] == null)
                {
                    continue;
                }
                foreach (var interactionJObject in contact["interactions"])
                {
                    var segment     = new VisitorSegment(contact.Value <string>("email"));
                    var interaction = interactionJObject.ToObject <Interaction>();

                    //set city
                    if (interaction.GeoData != null)
                    {
                        var city = _geoDataRepository.Cities.FirstOrDefault(x => x.GeoNameId == interaction.GeoData.GeoNameId);
                        segment.VisitorVariables.Add(new GeoVariables(() => city));
                    }

                    //set contact
                    segment.VisitVariables.Add(ExtractContact(contact));

                    //set channel (can be overriden below)
                    segment.VisitVariables.Add(new SingleVisitorVariable <string>("Channel", visit => interaction.ChannelId));


                    //set search options
                    if (!string.IsNullOrEmpty(interaction.SearchEngine))
                    {
                        var searchEngine = SearchEngine.SearchEngines.First(s => s.Id.Equals(interaction.SearchEngine, StringComparison.InvariantCultureIgnoreCase));
                        if (!string.IsNullOrEmpty(interaction.SearchKeyword))
                        {
                            var searchKeywords = interaction.SearchKeyword.Split(' ');
                            segment.VisitVariables.AddOrReplace(new ExternalSearchVariable(() => searchEngine, () => searchKeywords));
                        }
                    }

                    var pageItemInfos = interaction.Pages?.ToArray() ?? Enumerable.Empty <PageItemInfo>();
                    var pages         = new List <PageDefinition>();

                    foreach (var page in pageItemInfos)
                    {
                        var pageDefinition = new PageDefinition
                        {
                            Path = page.Path
                        };

                        //set goals
                        if (page.Goals != null)
                        {
                            pageDefinition.RequestVariables.Add("TriggerEvents", page.Goals.Select(x => new TriggerEventData
                            {
                                Id     = x.Id,
                                Name   = x.DisplayName,
                                IsGoal = true
                            }).ToList());
                        }
                        pages.Add(pageDefinition);
                    }


                    //set userAgent
                    SetUserAgent(segment);

                    //set datetime
                    segment.DateGenerator.Start = DateTime.Today.AddHours(12).AddMinutes(Randomness.Random.Next(-240, 240)).AddSeconds(Randomness.Random.Next(-240, 240)).Add(TimeSpan.Parse(interaction.Recency));


                    //set outcomes
                    if (interaction.Outcomes != null)
                    {
                        var outcomes = interaction.Outcomes.Select(x => x.Id.ToString());
                        var value    = new NormalGenerator(10, 5).Truncate(1);
                        segment.VisitVariables.AddOrReplace(new OutcomeVariable(() => new HashSet <string>(outcomes), value.Next));
                    }

                    //set campaign (can be overriden below)
                    if (!string.IsNullOrEmpty(interaction.CampaignId) && pageItemInfos.Any())
                    {
                        var pageItemInfo = pageItemInfos.First();
                        pageItemInfo.Path = pageItemInfo.Path + "?sc_camp=" + interaction.CampaignId;
                    }



                    var visitorBehavior = new StrictWalk(_sitecoreRoot, pages);
                    segment.Behavior = () => visitorBehavior;
                    segments.Add(segment);
                }
            }
            return(segments);
        }
Example #45
0
 public async Task DeleteJobType(JobType jobType)
 {
     _context.Remove(jobType);
     await _context.SaveChangesAsync();
 }
Example #46
0
        public JobType GetJobTypeById(Guid id)
        {
            JobType jobType = _unitOfWork.GetRepository <JobType>().FindById(id);

            return(jobType);
        }
Example #47
0
 public void SyncJobType(JobType oldJobType, JobType newJobType)
 {
     jobType = newJobType;
     RenameIDObject();
 }
		private static JobBase LoadDetailJobInfo(string jobID, JobType jobType)
		{
			JobBase result = null;

			WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder();
			builder.AppendItem("JOB_ID", jobID);

			switch (jobType)
			{
				case JobType.StartWorkflow:
					result = StartWorkflowJobAdapter.Instance.LoadSingleData(builder);
					break;
				case JobType.InvokeService:
					result = InvokeWebServiceJobAdapter.Instance.LoadSingleData(builder);
					break;
			}

			return result;
		}
Example #49
0
    private void OnClickEquipBtn(ButtonScript obj, object args, int param1, int param2)
    {
        if (Item == null)
        {
            return;
        }
        if (_itemData == null || _itemData.mainType_ != ItemMainType.IMT_Equip)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("zhaungbeileixingcuowu"));
            return;
        }

        Entity player = null;

        if (PlayerInstId == GamePlayer.Instance.InstId)
        {
            player = GamePlayer.Instance;
        }
        else
        {
            player = GamePlayer.Instance.GetEmployeeById((int)PlayerInstId);
        }


        if (player.GetIprop(PropertyType.PT_Level) / 10 + 1 < _itemData.level_)
        {
            //ErrorTipsUI.ShowMe(LanguageManager.instance.GetValue("equipLevel"));
            PopText.Instance.Show(LanguageManager.instance.GetValue("EN_OpenBaoXiangLevel"));
            return;
        }

        JobType    jt         = (JobType)player.GetIprop(PropertyType.PT_Profession);
        int        level      = player.GetIprop(PropertyType.PT_ProfessionLevel);
        Profession profession = Profession.get(jt, level);

        if (null == profession)
        {
            return;
        }



        if (_itemData.slot_ == EquipmentSlot.ES_Ornament_0 || _itemData.slot_ == EquipmentSlot.ES_Ornament_1)
        {
        }
        else
        {
            if (!profession.canuseItem(_itemData.subType_, _itemData.level_))
            {
                PopText.Instance.Show(LanguageManager.instance.GetValue("equipProfession"));
                return;
            }
        }

        if (!Item.isBind_ && _itemData.bindType_ == BindType.BIT_Use)
        {
            MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("shifoubangding"), () => {
                if (GamePlayer.Instance.isInBattle)
                {
                    Battle.Instance.UseItem((int)Item.instId_);
                    BagSystem.instance.battleOpenBag = false;
                    BagUI.HideMe();
                }
                //else
                //NetConnection.Instance.wearEquipment(PlayerInstId, Item.instId_);

                if (_itemData.slot_ == EquipmentSlot.ES_SingleHand)
                {
                    if (_itemData.subType_ == ItemSubType.IST_Shield)
                    {
                        if (player.Equips[(int)EquipmentSlot.ES_DoubleHand] != null)
                        {
                            NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_DoubleHand].instId_);
                        }
                    }
                    else
                    {
                        if (player.Equips[(int)EquipmentSlot.ES_DoubleHand] != null && ItemData.GetData((int)player.Equips[(int)EquipmentSlot.ES_DoubleHand].itemId_).subType_ != ItemSubType.IST_Shield)
                        {
                            NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_DoubleHand].instId_);
                        }
                    }
                }
                else if (_itemData.slot_ == EquipmentSlot.ES_DoubleHand)
                {
                    if (player.Equips[(int)EquipmentSlot.ES_SingleHand] != null)
                    {
                        NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_SingleHand].instId_);
                    }
                }
                else if (_itemData.slot_ == EquipmentSlot.ES_Ornament_0 || _itemData.slot_ == EquipmentSlot.ES_Ornament_1)
                {
                    if (GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0] != null && GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_1] != null)
                    {
                        if (ItemData.GetData((int)GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0].itemId_).subType_ == _itemData.subType_)
                        {
                            NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_0].instId_);
                        }
                        else if (ItemData.GetData((int)GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_1].itemId_).subType_ == _itemData.subType_)
                        {
                            NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_1].instId_);
                        }
                        else
                        {
                            NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_0].instId_);
                        }
                    }
                    else if (GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0] != null)
                    {
                        if (ItemData.GetData((int)GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0].itemId_).subType_ == _itemData.subType_)
                        {
                            NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(uint)EquipmentSlot.ES_Ornament_0].instId_);
                        }
                        else if (GamePlayer.Instance.Equips[(uint)EquipmentSlot.ES_Ornament_1] != null)
                        {
                            if (ItemData.GetData((int)(GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_1].itemId_)).subType_ == _itemData.subType_)
                            {
                                NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_1].instId_);
                            }
                        }
                    }
                    else if (GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_1] != null)
                    {
                        if (ItemData.GetData((int)GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_1].itemId_).subType_ == _itemData.subType_)
                        {
                            NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_1].instId_);
                        }
                        else if (GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0] != null)
                        {
                            if (ItemData.GetData((int)GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0].itemId_).subType_ == _itemData.subType_)
                            {
                                NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_0].instId_);
                            }
                        }
                    }
                }

                if (!GamePlayer.Instance.isInBattle)
                {
                    NetConnection.Instance.wearEquipment(PlayerInstId, Item.instId_);
                }
                tipPene.SetActive(false);
                if (closeCallback != null)
                {
                    closeCallback();
                }

                GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_EquipItem);
            }, false, () => {
                tipPene.SetActive(false);
                if (closeCallback != null)
                {
                    closeCallback();
                }
            });
        }
        else
        {
            if (GamePlayer.Instance.isInBattle)
            {
                Battle.Instance.UseItem((int)Item.instId_);
                BagSystem.instance.battleOpenBag = false;
                BagUI.HideMe();
            }
            //else
            //NetConnection.Instance.wearEquipment(PlayerInstId, Item.instId_);

            if (_itemData.slot_ == EquipmentSlot.ES_SingleHand)
            {
                if (_itemData.subType_ == ItemSubType.IST_Shield)
                {
                    if (player.Equips[(int)EquipmentSlot.ES_DoubleHand] != null)
                    {
                        NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_DoubleHand].instId_);
                    }
                }
                else
                {
                    if (player.Equips[(int)EquipmentSlot.ES_DoubleHand] != null && ItemData.GetData((int)player.Equips[(int)EquipmentSlot.ES_DoubleHand].itemId_).subType_ != ItemSubType.IST_Shield)
                    {
                        NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_DoubleHand].instId_);
                    }
                }
            }
            else if (_itemData.slot_ == EquipmentSlot.ES_DoubleHand)
            {
                if (player.Equips[(int)EquipmentSlot.ES_SingleHand] != null)
                {
                    NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_SingleHand].instId_);
                }
            }
            else if (_itemData.slot_ == EquipmentSlot.ES_Ornament_0 || _itemData.slot_ == EquipmentSlot.ES_Ornament_1)
            {
                if (GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0] != null && GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_1] != null)
                {
                    if (ItemData.GetData((int)GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0].itemId_).subType_ == _itemData.subType_)
                    {
                        NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_0].instId_);
                    }
                    else if (ItemData.GetData((int)GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_1].itemId_).subType_ == _itemData.subType_)
                    {
                        NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_1].instId_);
                    }
                    else
                    {
                        NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_0].instId_);
                    }
                }
                else if (GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0] != null)
                {
                    if (ItemData.GetData((int)GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0].itemId_).subType_ == _itemData.subType_)
                    {
                        NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(uint)EquipmentSlot.ES_Ornament_0].instId_);
                    }
                    else if (GamePlayer.Instance.Equips[(uint)EquipmentSlot.ES_Ornament_1] != null)
                    {
                        if (ItemData.GetData((int)(GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_1].itemId_)).subType_ == _itemData.subType_)
                        {
                            NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_1].instId_);
                        }
                    }
                }
                else if (GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_1] != null)
                {
                    if (ItemData.GetData((int)GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_1].itemId_).subType_ == _itemData.subType_)
                    {
                        NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_1].instId_);
                    }
                    else if (GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0] != null)
                    {
                        if (ItemData.GetData((int)GamePlayer.Instance.Equips[(int)EquipmentSlot.ES_Ornament_0].itemId_).subType_ == _itemData.subType_)
                        {
                            NetConnection.Instance.delEquipment(PlayerInstId, player.Equips[(int)EquipmentSlot.ES_Ornament_0].instId_);
                        }
                    }
                }
            }

            if (!GamePlayer.Instance.isInBattle)
            {
                NetConnection.Instance.wearEquipment(PlayerInstId, Item.instId_);
            }

            tipPene.SetActive(false);
            if (closeCallback != null)
            {
                closeCallback();
            }

            GuideManager.Instance.ProcEvent(ScriptGameEvent.SGE_EquipItem);
        }
    }
 public void GetNewJob(JobType jobType)
 {
     throw new NotImplementedException();
 }
Example #51
0
        public void Update()
        {
            string        strsql        = "update JobPost set " + "RecruiterId= " + RecruiterId + ", " + "JobTitle= '" + JobTitle.Replace("'", "''") + "', " + "CompanyId= " + CompanyId + ", " + "DepartmentId= " + DepartmentId + ", " + "DesignationId= " + DesignationId + ", " + "JobType= '" + JobType.Replace("'", "''") + "', " + "ApplicableToSex= '" + ApplicableToSex.Replace("'", "''") + "', " + "MinSalary= " + MinSalary + ", " + "MaxSalary= " + MaxSalary + ", " + "JobDescription= '" + JobDescription.Replace("'", "''") + "', " + "Status= '" + Status.Replace("'", "''") + "' " + " where ID =" + Id;
            SqlConnection ObjConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["MyJobPortal"].ConnectionString);

            ObjConnection.Open();
            SqlCommand ObjCommand = new SqlCommand(strsql, ObjConnection);

            ObjCommand.ExecuteNonQuery();
            ObjConnection.Dispose();
            ObjCommand.Dispose();
        }
 private static extern IntPtr CreateJobReflectionData(Type wrapperJobType, Type userJobType, JobType jobType, object managedJobFunction0, object managedJobFunction1, object managedJobFunction2);
Example #53
0
        public virtual Func <VisitorSegment> ParseSegments(JToken definition, JobType type)
        {
            if (definition == null || !definition.Any())
            {
                throw new Exception("At least one segment is required");
            }

            var segments = new Dictionary <string, KeyValuePair <VisitorSegment, double> >();

            foreach (var kv in (JObject)definition)
            {
                var segment = new VisitorSegment(kv.Key);
                var def     = (JObject)kv.Value;

                segment.DateGenerator.Hour(t => t.AddPeak(0.4, 0.25, 0, pct: true).AddPeak(0.8, 0.1, 2, 0.2, pct: true));
                //SetUserAgent(segment);


                if (type != JobType.Contacts)
                {
                    segment.VisitorVariables.Add(Variables.Random("VisitCount", new PoissonGenerator(3).Truncate(1, 10)));
                    segment.VisitorVariables.Add(Variables.Random("PageViews", new PoissonGenerator(3).Truncate(1, 10)));
                    segment.VisitVariables.Add(Variables.Random("Pause", new NormalGenerator(7, 7).Truncate(0.25)));
                }

                var visitorBehavior = new RandomWalk(_sitecoreRoot);
                segment.Behavior = () => visitorBehavior;

                segments.Add(kv.Key, new KeyValuePair <VisitorSegment, double>(segment, def.Value <double?>("Weight") ?? 1d));

                var copy = def["Copy"];
                if (copy != null)
                {
                    foreach (var name in copy.Values <string>())
                    {
                        segment.Copy(segments[name].Key);
                    }
                }

                var usedFactories = new HashSet <string>(StringComparer.InvariantCultureIgnoreCase);

                foreach (var prop in def)
                {
                    if (prop.Key == "Weight" || prop.Key == "Copy")
                    {
                        continue;
                    }

                    try
                    {
                        Factories[prop.Key].UpdateSegment(segment, prop.Value, this);
                        usedFactories.Add(prop.Key);
                    }
                    catch (KeyNotFoundException)
                    {
                        throw new Exception(string.Format("No factory registered for {0}", prop.Key));
                    }
                }

                foreach (var factory in Factories.Where(factory => !usedFactories.Contains(factory.Key)))
                {
                    factory.Value.SetDefaults(segment, this);
                }

                segment.SortVariables();
            }

            return(segments.Values.Weighted());
        }
    public void UpdateJobsList()
    {
        screen_Jobs.SetActive(false);

        foreach (Transform child in screen_Jobs.transform)
        {
            Destroy(child.gameObject);
        }

        foreach (Occupation occupation in OccupationList.Instance.Occupations)
        {
            JobType jobType = occupation.JobType;

            //NOTE: Commenting this out because it can actually be changed just by editing allowed occupation list,
            //doesn't need manual removal and this allows direct spawning as syndie for testing just by adding them
            //to that list
            // For nuke ops mode, syndis spawn via a different button
            // if (jobType == JobType.SYNDICATE)
            // {
            //  continue;
            // }

            int active    = GameManager.Instance.GetOccupationsCount(jobType);
            int available = GameManager.Instance.GetOccupationMaxCount(jobType);

            GameObject occupationGO = Instantiate(buttonPrefab, screen_Jobs.transform);

            // This line was added for unit testing - but now it's only rewrite occupations meta
            //occupation.name = jobType.ToString();

            var image = occupationGO.GetComponent <Image>();
            var text  = occupationGO.GetComponentInChildren <TextMeshProUGUI>();

            image.color = occupation.ChoiceColor;
            text.text   = occupation.DisplayName + " (" + active + " of " + available + ")";
            occupationGO.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);

            // Disabled button for full jobs
            if (active >= available)
            {
                occupationGO.GetComponentInChildren <Button>().interactable = false;
            }
            else             // Enabled button with listener for vacant jobs
            {
                occupationGO.GetComponent <Button>().onClick.AddListener(() => { BtnOk(jobType); });
            }

            var check = PlayerList.Instance.ClientCheckBanReturn(occupation.JobType);

            if (check != null)
            {
                var entryTime = DateTime.ParseExact(check.dateTimeOfBan, "O", CultureInfo.InvariantCulture);
                var totalMins = Mathf.Abs((float)(entryTime - DateTime.Now).TotalMinutes);

                image.color = Color.red;
                var msg = check.isPerma ? "Perma Banned" : $"banned for {Mathf.RoundToInt((float)check.minutes - totalMins)} minutes";
                text.text = occupation.DisplayName + $" is {msg}";

                occupationGO.GetComponent <Button>().interactable = false;
            }

            // Job window listener
            Occupation         occupationOfTrigger = occupation;
            EventTrigger.Entry entry = new EventTrigger.Entry();
            entry.eventID = EventTriggerType.PointerEnter;
            entry.callback.AddListener((eventData) => { jobInfo.Job = occupationOfTrigger; });
            occupationGO.GetComponent <EventTrigger>().triggers.Add(entry);

            occupationGO.SetActive(true);
        }


        screen_Jobs.SetActive(true);
    }
Example #55
0
 public JobHandle Schedule <T>(JobType jobType, int batchCount, JobHandle dependencies, T job) where T : struct, IJobParallelFor
 {
     return(Schedule(jobType == JobType.Run, batchCount, dependencies, job));
 }
 public static JobDepartment GetJobDepartment(JobType job)
 {
     return(DepartmentJobs.FirstOrDefault(x => x.Value.Contains(job)).Key);
 }
 public static IntPtr CreateJobReflectionData(Type type, JobType jobType, object managedJobFunction0, object managedJobFunction1 = null, object managedJobFunction2 = null)
 {
     return(CreateJobReflectionData(type, type, jobType, managedJobFunction0, managedJobFunction1, managedJobFunction2));
 }
Example #58
0
 public DialogueOption(string line, DialogueOutcome outcome, SpeciesType species, JobType job, Required required)
 {
     this.line     = line;
     this.outcome  = outcome;
     this.species  = species;
     this.job      = job;
     this.required = required;
 }
Example #59
0
 private void InitializeMembers()
 {
     this.job = null;
     this.jobType = JobType.Unknown;
     this.query = null;
     this.schemaName = null;
     this.objectName = null;
     this.path = null;
 }
 public static IntPtr CreateJobReflectionData(Type wrapperJobType, Type userJobType, JobType jobType, object managedJobFunction0)
 {
     return(CreateJobReflectionData(wrapperJobType, userJobType, jobType, managedJobFunction0, null, null));
 }