using System.Collections.Generic; namespace ET { public static class PeopleOperate { public static int StopBehave(Unit unit, People people) { if (people == null) { return ErrorCode.ERR_PeopleNotFound; } var peopleBehave = people.GetBehaveType(); var targetId = people.GetTargetId(); switch (peopleBehave) { case ConstBehaveType.BEHAVE_GATHER: case ConstBehaveType.BEHAVE_PREPARE_GATHER: GatherOperate.StopGather(unit, targetId, people.Id); break; case ConstBehaveType.BEHAVE_CONSTRUCT: case ConstBehaveType.BEHAVE_PREPARE_CONSTRUCT: ConstructOperate.StopConstruct(unit, targetId, people.Id); break; } people.SetBehaveType(ConstBehaveType.BEHAVE_IDLE); people.SetTargetId(0); return ErrorCode.ERR_Success; } } }