/// <summary> /// 指派工作人员 /// </summary> public void AssignBuildingWorkers() { float compositeWorkIndex = HumanResource.GetCompositeWorkIndex(this.partId, this.placeId); MajordomoWindow.instance.AppendMessage(this.currDate, Message.IMPORTANCE_NORMAL, TaiwuCommon.SetColor(TaiwuCommon.COLOR_LIGHT_BLUE, "开始指派工作人员") + " - " + TaiwuCommon.SetColor(TaiwuCommon.COLOR_DARK_BROWN, "综合工作指数") + ": " + TaiwuCommon.SetColor(TaiwuCommon.COLOR_WHITE, compositeWorkIndex.ToString())); Original.RemoveWorkersFromBuildings(this.partId, this.placeId, this.excludedBuildings, this.excludedWorkers); MajordomoWindow.instance.AppendMessage(this.currDate, Message.IMPORTANCE_LOWEST, TaiwuCommon.SetColor(TaiwuCommon.COLOR_DARK_GRAY, "开始第一轮指派……")); this.AssignBuildingWorkers_PrepareData(); this.AssignBedroomWorkers(); MajordomoWindow.instance.AppendMessage(this.currDate, Message.IMPORTANCE_LOWEST, TaiwuCommon.SetColor(TaiwuCommon.COLOR_DARK_GRAY, "开始第二轮指派……")); // 指派完厢房后,重新计算 this.AssignBuildingWorkers_PrepareData(); this.AssignLeftBuildings(); Original.UpdateAllBuildings(this.partId, this.placeId); compositeWorkIndex = HumanResource.GetCompositeWorkIndex(this.partId, this.placeId); MajordomoWindow.instance.AppendMessage(this.currDate, Message.IMPORTANCE_NORMAL, TaiwuCommon.SetColor(TaiwuCommon.COLOR_LIGHT_BLUE, "结束指派工作人员") + " - " + TaiwuCommon.SetColor(TaiwuCommon.COLOR_DARK_BROWN, "综合工作指数") + ": " + TaiwuCommon.SetColor(TaiwuCommon.COLOR_WHITE, compositeWorkIndex.ToString())); MajordomoWindow.instance.SetCompositeWorkIndex(this.currDate, compositeWorkIndex); }
/// <summary> /// 自动指派工作人员 /// </summary> public void AssignBuildingWorkers() { Main.Logger.Log($"自动指派前综合工作指数: {HumanResource.GetComprehensiveWorkIndex(this.partId, this.placeId)}"); Original.RemoveWorkersFromBuildings(this.partId, this.placeId, this.excludedBuildings, this.excludedWorkers); Main.Logger.Log("开始第一轮指派……"); this.AssignBuildingWorkers_PrepareData(); this.AssignBedroomWorkers(); Main.Logger.Log("开始第二轮指派……"); // 指派完厢房后,重新计算 this.AssignBuildingWorkers_PrepareData(); this.AssignLeftBuildings(); Original.UpdateAllBuildings(this.partId, this.placeId); Main.Logger.Log($"自动指派后综合工作指数: {HumanResource.GetComprehensiveWorkIndex(this.partId, this.placeId)}"); }