protected virtual bool GiveWorkerTo(FactionArmy army, War war) { return(true); }
public virtual void Initialize(War war) { this.war = war; }
protected virtual bool CanGiveSubTo(FactionArmy army, War war) { return(true); }
public virtual void Notify_WarIsOver(War war) { }
public virtual void Notify_WarIsStarted(War war) { }
private void DrawWarMode(Rect inRect) { Text.Anchor = TextAnchor.MiddleCenter; float y = inRect.y; Rect titleRect = new Rect(inRect.x, y, inRect.width, 25); Widgets.Label(titleRect, "MakeWarWindow_DrawWarModeTitle".Translate(interactFaction.Faction.Name)); y += 30; Rect selectWarGoalRect = new Rect(inRect.x, y, inRect.width, 25); if (GUIUtils.DrawCustomButton(selectWarGoalRect, "MakeWarWindow_DrawWarMode_SelectWarGoal".Translate(warGoalDef.LabelCap), Color.white)) { List <FloatMenuOption> options = new List <FloatMenuOption>(); foreach (var goal in DefDatabase <WarGoalDef> .AllDefs) { options.Add(new FloatMenuOption(goal.LabelCap, delegate { warGoalDef = goal; })); } Find.WindowStack.Add(new FloatMenu(options)); } y += 28; Text.Anchor = TextAnchor.UpperLeft; float height = inRect.height - y - 80; Rect fullInfoRect = new Rect(inRect.x, y, inRect.width, height); Widgets.Label(fullInfoRect, warGoalDef.description); y += height; Text.Anchor = TextAnchor.MiddleCenter; Rect warNameRect = new Rect(inRect.x, y, inRect.width, 25); Widgets.Label(warNameRect, "MakeWarWindow_WarNameLabel".Translate()); y += 22; warNameRect.y += 22; editBufferName = Widgets.TextField(warNameRect, editBufferName); y += 30; Rect createWarButtonRect = new Rect(inRect.x, y, inRect.width, 25); if (GUIUtils.DrawCustomButton(createWarButtonRect, "MakeWarWindow_DrawWarMode_MakeWar".Translate(interactFaction.Faction.Name), Color.white)) { if (string.IsNullOrEmpty(editBufferName)) { Messages.Message("MakeWarWindow_EmptyName".Translate(), MessageTypeDefOf.NeutralEvent); } else { War war = WarMaker.MakeWar(editBufferName, warGoalDef, QuestsManager.Communications.FactionManager.GetInteraction(speaker.Faction), interactFaction); QuestsManager.Communications.FactionManager.AddWar(war); war.StartWar(); Close(); } } Text.Anchor = TextAnchor.UpperLeft; }
public virtual void StartWar(War war) { this.war = war; }