C# Класс SSTUTools.SSTUResourceList

Will be the base class for manipulating resources in a part, including cross-module manipulation.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addResource ( String name, float fillMaxUnits ) : void

Add a resource, by units, setting/adjusting fill and max units by the units specified

addResource ( string name, float fill, float max ) : void

Add a resource, by units, setting/adjusting fill and max units by the units specified

addResourceByVolume ( String name, float cubicMetersTotalFilled ) : void

Add a resource, by volume, setting/adjusting fill and max units by the volume specified

addResourceByVolume ( string name, float cubicMetersFilled, float totalCubicMeters ) : void

Add a resource, by volume, setting/adjusting fill and max units by the volumes specified

removeResource ( String name ) : void

Remove a resource from the list entirely

removeResource ( String name, float removeFromMax ) : void

Remove a specified number of units from the resource maximum; if fill>max after this, fill will be set to max. If max==0, resource will be removed from list entirely

removeResource ( String name, float removeFromFill, float removeFromMax ) : void

Remove a specified number of units from the resource fill and maximum values; if fill>max after this, fill will be set to max. If max==0, resource will be removed from list entirely

setResource ( string name, float fill, float max ) : void

Blindly set the quanity of a resource. Adds new resource if not present, removes resource if present and max==0.

setResourcesToPart ( Part part ) : void

Actually set the resources from this list to the input part; if the current part resources match this list exactly they will be updated in-place, else all resources from the part will be cleared and the new list of resources added.

Описание методов

addResource() публичный Метод

Add a resource, by units, setting/adjusting fill and max units by the units specified
public addResource ( String name, float fillMaxUnits ) : void
name String
fillMaxUnits float
Результат void

addResource() публичный Метод

Add a resource, by units, setting/adjusting fill and max units by the units specified
public addResource ( string name, float fill, float max ) : void
name string
fill float
max float
Результат void

addResourceByVolume() публичный Метод

Add a resource, by volume, setting/adjusting fill and max units by the volume specified
public addResourceByVolume ( String name, float cubicMetersTotalFilled ) : void
name String
cubicMetersTotalFilled float
Результат void

addResourceByVolume() публичный Метод

Add a resource, by volume, setting/adjusting fill and max units by the volumes specified
public addResourceByVolume ( string name, float cubicMetersFilled, float totalCubicMeters ) : void
name string
cubicMetersFilled float
totalCubicMeters float
Результат void

removeResource() публичный Метод

Remove a resource from the list entirely
public removeResource ( String name ) : void
name String
Результат void

removeResource() публичный Метод

Remove a specified number of units from the resource maximum; if fill>max after this, fill will be set to max. If max==0, resource will be removed from list entirely
public removeResource ( String name, float removeFromMax ) : void
name String
removeFromMax float
Результат void

removeResource() публичный Метод

Remove a specified number of units from the resource fill and maximum values; if fill>max after this, fill will be set to max. If max==0, resource will be removed from list entirely
public removeResource ( String name, float removeFromFill, float removeFromMax ) : void
name String
removeFromFill float
removeFromMax float
Результат void

setResource() публичный Метод

Blindly set the quanity of a resource. Adds new resource if not present, removes resource if present and max==0.
public setResource ( string name, float fill, float max ) : void
name string
fill float
max float
Результат void

setResourcesToPart() публичный Метод

Actually set the resources from this list to the input part; if the current part resources match this list exactly they will be updated in-place, else all resources from the part will be cleared and the new list of resources added.
public setResourcesToPart ( Part part ) : void
part Part
Результат void