/// <summary>
    /// Gets the array of hardpoints for the specific type of socket.
    /// </summary>
    public Hardpoint[] GetAllCompatible(HPSocket socket)
    {
        int intSocket = (int)socket;

        if ((intSocket & (int)HardpointType.Targeted) != 0)
        {
            return(targeted);
        }
        else if ((intSocket & (int)HardpointType.Utility) != 0)
        {
            return(utility);
        }
        else if ((intSocket & (int)HardpointType.Passive) != 0)
        {
            return(passive);
        }
        else if ((intSocket & (int)HardpointType.Structural) != 0)
        {
            return(structures);
        }
        else
        {
            return(null);
        }
    }
Esempio n. 2
0
    /// <summary>
    /// Determines whether this group can add the specified hardpoint.
    /// </summary>
    /// <param name="hardpoint">The hardpoint to try and add to the group.</param>
    /// <returns><c>true</c> if this group can add the specified hardpoint; otherwise, <c>false</c>.</returns>
    public bool CanAddHardPoint(Hardpoint hardpoint)
    {
        if (hardpoint.Module == null)
        {
            return(false);            // Cannot add an empty socket.
        }

        // See if the socket group can take the module.
        ActorModule module    = hardpoint.Module;
        HPSocket    typeFlags = module.socket;

        if ((typeFlags & HPSocket.Passive) == HPSocket.Passive)
        {
            return((flags & Flags.Passive) == Flags.Passive);
        }

        if ((typeFlags & HPSocket.Utility) == HPSocket.Utility)
        {
            return((flags & Flags.Utility) == Flags.Utility);
        }

        if ((typeFlags & HPSocket.Targeted) == HPSocket.Targeted)
        {
            return((flags & Flags.Targeted) == Flags.Targeted);
        }

        // Dunno what happened, so no.
        return(false);
    }
Esempio n. 3
0
 /// <summary>
 /// Returns whether the hardpoint can install a module with the
 /// provided type of socket.
 /// </summary>
 public bool IsCompatible(HPSocket toInstall)
 {
     return(socket == toInstall);
 }
Esempio n. 4
0
 /// <summary>
 /// Create a new HardPoint with the specific socket type.
 /// </summary>
 public Hardpoint(HPSocket socket)
     : this()
 {
     this.socket = socket;
 }