コード例 #1
0
ファイル: JobManager.cs プロジェクト: poklar/ProjectAona
        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);
        }
コード例 #2
0
        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);
        }