Beispiel #1
0
		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;
					}
			}
		}
Beispiel #2
0
        public Order(string orderstring, Order order)
            : this(orderstring, order.Subject, order.TargetActor, order.TargetLocation,
				   order.TargetString, order.Queued, order.ExtraLocation, order.ExtraData)
        {
        }
Beispiel #3
0
		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 */
Beispiel #5
0
 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;
     }
 }
Beispiel #6
0
 // Hide the OrderManager from mod code
 public void IssueOrder(Order o)
 {
     OrderManager.IssueOrder(o);
 }