public void CreateJob(IQueueable item, Tile tile) { JobType jobType = JobType.Idle; if (item.GetType() == typeof(Wall)) { jobType = JobType.Building; Wall wall = item as Wall; wall.BlueprintType = BlueprintType.Stockpile; } Job job = new Job(tile, jobType); job.JobObjectPrototype = item; job.JobComplete += OnJobComplete; job.JobCancel += OnJobCancel; tile.Enterability = EnterabilityType.IsEnterable; tile.Blueprint = item; tile.IsOccupied = true; _jobs.Add(job, item); JobQueue.Enqueue(job); }
public static BattleUnit getActiveUnit() { BattleUnit unit = null; IQueueable activeItem = instance.queue.getActiveItem(); if (activeItem != null) { if (activeItem.GetType() == typeof(BattleUnit)) { unit = (BattleUnit)activeItem; } } return(unit); }