Beispiel #1
0
 private void LateUpdate()
 {
     Diagnostics.Assert(this.pendingDiscoveryNotifications != null);
     if (this.pendingDiscoveryNotifications.Count > 0)
     {
         for (int i = 0; i < this.pendingDiscoveryNotifications.Count; i++)
         {
             OrderNotifyEmpireDiscovery order = this.pendingDiscoveryNotifications[i];
             Diagnostics.Assert(this.PlayerController != null);
             this.PlayerController.PostOrder(order);
         }
         this.pendingDiscoveryNotifications.Clear();
     }
 }
Beispiel #2
0
    private void OnEmpireSymetricDiscovery(global::Empire initiatorEmpire, global::Empire discoveredEmpire, WorldPosition initiatorEmpirePosition, WorldPosition discoveredEmpirePosition)
    {
        if (initiatorEmpire == null || discoveredEmpire == null)
        {
            throw new ArgumentNullException();
        }
        Diagnostics.Assert(this.pendingDiscoveryNotifications != null);
        OrderNotifyEmpireDiscovery orderNotifyEmpireDiscovery = this.pendingDiscoveryNotifications.Find((OrderNotifyEmpireDiscovery match) => (match.InitiatorEmpireIndex == initiatorEmpire.Index && match.DiscoveredEmpireIndex == discoveredEmpire.Index) || (match.InitiatorEmpireIndex == discoveredEmpire.Index && match.DiscoveredEmpireIndex == initiatorEmpire.Index));

        if (orderNotifyEmpireDiscovery == null)
        {
            orderNotifyEmpireDiscovery = new OrderNotifyEmpireDiscovery(initiatorEmpire.Index, discoveredEmpire.Index);
            this.pendingDiscoveryNotifications.Add(orderNotifyEmpireDiscovery);
        }
        orderNotifyEmpireDiscovery.InitiatorEmpirePosition  = initiatorEmpirePosition;
        orderNotifyEmpireDiscovery.DiscoveredEmpirePosition = discoveredEmpirePosition;
    }