Exemplo n.º 1
0
 public void crewmanWakeUpCount(Crewman crewman)//시간이 되면 깨우기
 {
     if (crewman.gettime() == calendar.time)
     {
         crewman.setSleep(false);
         crewman.setActingType(Acting.NOTHING);
     }
 }
Exemplo n.º 2
0
    public bool crewmanSleep(Crewman crewman)//재우기
    {
        int behavior;
        int time = -1;

        if (actingCheck(crewman))
        {
            stealDrive(crewman);

            if (7 <= calendar.time && calendar.time < 19)
            {
                crewman.setSleep(true);
                crewman.setActingType(Acting.SLEEP);
                behavior = crewman.getbehavior() + 5;
                if (behavior > 10)
                {
                    behavior = 10;
                }
                crewman.setbehavior(behavior);
                time = calendar.time + 4;
                if (time >= 24)
                {
                    time -= 24;
                }
            }
            else
            {
                crewman.setSleep(true);
                crewman.setActingType(Acting.SLEEP);
                crewman.setbehavior(10);
                time = calendar.time + 6;
                if (time >= 24)
                {
                    time -= 24;
                }
            }
            crewman.settime(time);
            return(true);
        }
        return(false);
    }