예제 #1
0
    public bool IsAllowed(Schedulable schedulable, ScheduleBlockType schedule_block_type)
    {
        int           blockIdx = Schedule.GetBlockIdx();
        ScheduleBlock block    = GetSchedule(schedulable).GetBlock(blockIdx);

        return(block.IsAllowed(schedule_block_type));
    }
    private void OnScheduleBlocksTick(object data)
    {
        Schedule      schedule = (Schedule)data;
        ScheduleBlock block    = schedule.GetBlock(Schedule.GetLastBlockIdx());
        ScheduleBlock block2   = schedule.GetBlock(Schedule.GetBlockIdx());
        bool          flag     = block.IsAllowed(Db.Get().ScheduleBlockTypes.Recreation);
        bool          flag2    = block2.IsAllowed(Db.Get().ScheduleBlockTypes.Recreation);

        breakBlocks[Schedule.GetLastBlockIdx()] = flag;
        if (flag && !flag2)
        {
            int num = 0;
            foreach (bool breakBlock in breakBlocks)
            {
                if (breakBlock)
                {
                    num++;
                }
            }
            ApplyBreakBonus(num);
        }
    }