예제 #1
0
 private void handleShipDeath(ShipPhaseEvent e)
 {
     _incrementDeathCount.OnNext(new IncrementDeathCount(1));
     _logEvent.OnNext(new LogEvent($"{NameGenerator.GetName()} has died in combat"));
     shipByID.Remove(e.ship.shipID);
     //if this ship was in the queue, remove it from the queue
     this.hangarQueue.Remove(e.ship.shipID);
 }
예제 #2
0
 private void handleShipDockingRequest(ShipPhaseEvent e)
 {
     //check if ship exists
     ensureShipIsRegistered(e.ship);
     //add this ship to the waiting list
     this.hangarQueue.Add(e.ship.shipID);
     //if there is nobody here, just call them in now
     if (this.hangarQueue.Count == 1 && shipInHanger == 0)
     {
         nextPlease();
     }
     Debug.Log("EVENT: SHIP ASKING TO DOCK. this.hangarQueue.Count: " + this.hangarQueue.Count + " shipInHanger: " + shipInHanger);
 }
예제 #3
0
    private void handleShipDeparture(ShipPhaseEvent e)
    {
        //check if ship exists
        ensureShipIsRegistered(e.ship);

        shipInHanger = 0;
        //check if anybody is in the lineup
        if (this.hangarQueue.Count > 0)
        {
            nextPlease();
        }
        Debug.Log("EVENT: SHIP DEPARTING");
        _shipExitingDock.OnNext(new ShipExitingDock());
    }
예제 #4
0
    private void handleShipEmergency(ShipPhaseEvent e)
    {
        //check if ship exists
        ensureShipIsRegistered(e.ship);
        Debug.LogWarning("YO JUSTIN: NOT SURE HOW WE WANT THIS TO INTERACT WITH DOORS AND ALARMS AND STUFF. THERE IS POTENTIAL");
        //let the busted-ass ship skip the line
        this.hangarQueue.Remove(e.ship.shipID);
        this.hangarQueue.Insert(0, e.ship.shipID);

        //we are going to tell the current ship to GTFO
        if (shipInHanger > 0)
        {
            if (this.shipByID.ContainsKey(shipInHanger))
            {
                Ship currentShip = this.shipByID[shipInHanger];
                currentShip.startBattle();
            }
        }
    }