Пример #1
0
        public static Packet GetPacket(ShipSystems system, float value)
        {
            EngSetEnergySubPacket esesp = new EngSetEnergySubPacket(system, value);
            ShipAction3Packet     sap3  = new ShipAction3Packet(esesp);

            return(new Packet(sap3));
        }
        public static Packet GetPacket(ShipSystems system, int value)
        {
            EngSetCoolantSubPacket escsp = new EngSetCoolantSubPacket(system, value);
            ShipAction2Packet      sap2  = new ShipAction2Packet(escsp);

            return(new Packet(sap2));
        }
Пример #3
0
 public EngSetEnergySubPacket(ShipSystems system, float value)
 {
     if (_log.IsDebugEnabled)
     {
         _log.DebugFormat("Starting {0}", MethodBase.GetCurrentMethod().ToString());
     }
     System = system;
     Value  = value;
     if (_log.IsDebugEnabled)
     {
         _log.DebugFormat("Ending {0}", MethodBase.GetCurrentMethod().ToString());
     }
 }
Пример #4
0
    public bool AssignMembersFromAirVent(IMyAirVent newVent, ShipSystems shipSystems)
    {
        this.airVent = newVent;

        string desiredStateString = GetKeyValue(newVent.CustomData, "AirlockController.DesiredState");

        if (desiredStateString == null)
        {
            return(false);  // State string wasn't found.
        }
        this.desiredState = getStateFromString(desiredStateString);

        string airSideDoorName = GetKeyValue(newVent.CustomData, "AirlockController.AirSideDoorName");

        if (airSideDoorName == null)
        {
            return(false);
        }
        for (int i = 0; i < shipSystems.doors.Count; ++i)
        {
            if (shipSystems.doors[i].CustomName == airSideDoorName)
            {
                this.airSideDoor = shipSystems.doors[i];
            }
        }
        if (this.airSideDoor == null)
        {
            return(false);  // Specified door wasn't found.
        }
        string spaceSideDoorName = GetKeyValue(newVent.CustomData, "AirlockController.SpaceSideDoorName");

        if (spaceSideDoorName == null)
        {
            return(false);
        }
        for (int i = 0; i < shipSystems.doors.Count; ++i)
        {
            if (shipSystems.doors[i].CustomName == spaceSideDoorName)
            {
                this.spaceSideDoor = shipSystems.doors[i];
            }
        }
        if (this.spaceSideDoor == null)
        {
            return(false);  // Specified door wasn't found.
        }
        return(true);
    }
Пример #5
0
 public virtual void Initialize(ShipSystems myship)
 {
     myShip = myship;
 }
Пример #6
0
 public void SendEngSetEngerySubPacket(Guid connectionID, ShipSystems system, float value)
 {
     Send(connectionID, EngSetEnergySubPacket.GetPacket(ShipSystems.WarpJumpDrive, 0));
 }
Пример #7
0
 public void SendEngSetCoolantSubPacket(Guid connectionID, ShipSystems system, int value)
 {
     Send(connectionID, EngSetCoolantSubPacket.GetPacket(system, value));
 }