public static void PlayVoiceForOrders(this World w, Order[] orders) { // Find an actor with a phrase to say foreach (var o in orders) { if (o == null) continue; var orderSubject = o.Subject; if (orderSubject.Disposed) continue; foreach (var voice in orderSubject.TraitsImplementing<IVoiced>()) foreach (var v in orderSubject.TraitsImplementing<IOrderVoice>()) { if (voice.PlayVoice(orderSubject, v.VoicePhraseForOrder(orderSubject, o), orderSubject.Owner.Faction.InternalName)) return; } } }
public Order(string orderstring, Order order) : this(orderstring, order.Subject, order.TargetActor, order.TargetLocation, order.TargetString, order.Queued, order.ExtraLocation, order.ExtraData) { }
public Order(string orderstring, Order order) : this(orderstring, order.Subject, order.TargetActor, order.TargetLocation, order.TargetString, order.Queued, order.ExtraLocation, order.ExtraData) {}
public void IssueOrder(Order o) { OrderManager.IssueOrder(o); } /* avoid exposing the OM to mod code */
public static void PlayVoiceForOrders(this World w, Order[] orders) { // Find an actor with a phrase to say foreach (var o in orders) { if (o.Subject.Destroyed) continue; foreach (var v in o.Subject.TraitsImplementing<IOrderVoice>()) if (Sound.PlayVoice(v.VoicePhraseForOrder(o.Subject, o), o.Subject, o.Subject.Owner.Country.Race)) return; } }
// Hide the OrderManager from mod code public void IssueOrder(Order o) { OrderManager.IssueOrder(o); }