Beispiel #1
0
    public override LaunchStatus EvaluateLaunchCondition()
    {
        int id = SpacecraftManager.instance.GetSpacecraftFromLaunchConditionManager(commandModule.GetComponent <LaunchConditionManager>()).id;
        SpaceDestination spacecraftDestination = SpacecraftManager.instance.GetSpacecraftDestination(id);

        if (spacecraftDestination != null && CanReachDestination(spacecraftDestination) && spacecraftDestination.GetDestinationType().visitable)
        {
            return(LaunchStatus.Ready);
        }
        return(LaunchStatus.Failure);
    }
Beispiel #2
0
    public override LaunchStatus EvaluateLaunchCondition()
    {
        int id = SpacecraftManager.instance.GetSpacecraftFromLaunchConditionManager(commandModule.GetComponent <LaunchConditionManager>()).id;
        SpaceDestination spacecraftDestination = SpacecraftManager.instance.GetSpacecraftDestination(id);

        if (spacecraftDestination != null && SpacecraftManager.instance.GetDestinationAnalysisState(spacecraftDestination) == SpacecraftManager.DestinationAnalysisState.Complete && spacecraftDestination.AvailableMass >= CargoCapacity(spacecraftDestination, commandModule))
        {
            return(LaunchStatus.Ready);
        }
        return(LaunchStatus.Warning);
    }
 public override LaunchStatus EvaluateLaunchCondition()
 {
     foreach (GameObject item in AttachableBuilding.GetAttachedNetwork(commandModule.GetComponent <AttachableBuilding>()))
     {
         CargoBay component = item.GetComponent <CargoBay>();
         if ((Object)component != (Object)null && component.storage.MassStored() != 0f)
         {
             return(LaunchStatus.Failure);
         }
     }
     return(LaunchStatus.Ready);
 }
Beispiel #4
0
    public override LaunchStatus EvaluateLaunchCondition()
    {
        MinionStorage             component        = module.GetComponent <MinionStorage>();
        List <MinionStorage.Info> storedMinionInfo = component.GetStoredMinionInfo();

        if (storedMinionInfo.Count > 0)
        {
            MinionStorage.Info info = storedMinionInfo[0];
            if (info.serializedMinion != null)
            {
                return(LaunchStatus.Ready);
            }
        }
        return(LaunchStatus.Failure);
    }
    public float GetDryMass()
    {
        float num = 0f;

        foreach (GameObject item in AttachableBuilding.GetAttachedNetwork(commandModule.GetComponent <AttachableBuilding>()))
        {
            RocketModule component = item.GetComponent <RocketModule>();
            if ((Object)component != (Object)null)
            {
                num += component.GetComponent <PrimaryElement>().Mass;
            }
        }
        return(num);
    }
Beispiel #6
0
    public static float CargoCapacity(SpaceDestination destination, CommandModule module)
    {
        if ((Object)module == (Object)null)
        {
            return(0f);
        }
        float num = 0f;

        foreach (GameObject item in AttachableBuilding.GetAttachedNetwork(module.GetComponent <AttachableBuilding>()))
        {
            CargoBay component = item.GetComponent <CargoBay>();
            if ((Object)component != (Object)null && destination.HasElementType(component.storageType))
            {
                Storage component2 = component.GetComponent <Storage>();
                num += component2.capacityKg;
            }
        }
        return(num);
    }