C# Класс EnergyUsingObject

Наследование: SimObject
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
ReceiveEnergy ( ) : float

Receives the energy. called from the plug load.. amt of energy used.

addBattery ( Battery, bat ) : void

Adds the battery to batteryList

connectToPlugLoad ( PlugLoad, pl ) : void
disconnectFromPlugLoad ( ) : void
getBatteryEnergyAt ( int batIndex ) : float

Gets the battery level at batIndex.

getConnectedPlugLoad ( ) : PlugLoad,
getEnergyUsagePerSec ( ) : float

Gets the energy usage per sec.

getIsEnergySupplied ( ) : bool

Gets the is energy supplied.

getIsPluggedIn ( ) : bool
getIsPoweredOn ( ) : bool

Gets if is powered on.

getIsUsingBattery ( ) : bool

Gets the is using battery.

getNumBatteries ( ) : int

Gets the number batteries.

getTotalEnergyUsage ( ) : float

Gets the total energy usage.

powerOff ( ) : bool

Powers off.

powerOn ( ) : bool

Powers on.

removeBatteryAt ( int batIndex ) : void

Removes the battery at batIndex.

setBatteryEnergyAt ( int batIndex, float amt ) : void

Sets the battery energy at batIndex and set to amt.

startSupplyingEnergy ( ) : void

Starts the supplying energy.

startUsingBattery ( ) : void

Starts the using battery.

stopSupplyingEnergy ( ) : void

Stops the supplying energy.

stopUsingBattery ( ) : void

Stops the using battery.

toggleSupplyingEnergy ( ) : void
toggleSupplyingEnergy ( Button sender ) : void

for when a button in the ui has to toggle this that way this method auto sets whatever button it was. Hopefully that button is linked to the proper EUO. Oh well.

Приватные методы

Метод Описание
Awake ( ) : void
Start ( ) : void
Update ( ) : void

Update this instance. /// Updates the energy use. Does necessary calculations for averages and totals. should be called each frame from the energy hub.

hasPower ( ) : bool

returns if has power.

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

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

Receives the energy. called from the plug load.. amt of energy used.
public ReceiveEnergy ( ) : float
Результат float

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

Adds the battery to batteryList
public addBattery ( Battery, bat ) : void
bat Battery, Bat. the Battery to add
Результат void

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

public connectToPlugLoad ( PlugLoad, pl ) : void
pl PlugLoad,
Результат void

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

public disconnectFromPlugLoad ( ) : void
Результат void

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

Gets the battery level at batIndex.
public getBatteryEnergyAt ( int batIndex ) : float
batIndex int Bat index.
Результат float

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

public getConnectedPlugLoad ( ) : PlugLoad,
Результат PlugLoad,

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

Gets the energy usage per sec.
public getEnergyUsagePerSec ( ) : float
Результат float

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

Gets the is energy supplied.
public getIsEnergySupplied ( ) : bool
Результат bool

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

public getIsPluggedIn ( ) : bool
Результат bool

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

Gets if is powered on.
public getIsPoweredOn ( ) : bool
Результат bool

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

Gets the is using battery.
public getIsUsingBattery ( ) : bool
Результат bool

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

Gets the number batteries.
public getNumBatteries ( ) : int
Результат int

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

Gets the total energy usage.
public getTotalEnergyUsage ( ) : float
Результат float

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

Powers off.
public powerOff ( ) : bool
Результат bool

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

Powers on.
public powerOn ( ) : bool
Результат bool

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

Removes the battery at batIndex.
public removeBatteryAt ( int batIndex ) : void
batIndex int Bat index.
Результат void

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

Sets the battery energy at batIndex and set to amt.
public setBatteryEnergyAt ( int batIndex, float amt ) : void
batIndex int Bat index.
amt float Amt.
Результат void

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

Starts the supplying energy.
public startSupplyingEnergy ( ) : void
Результат void

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

Starts the using battery.
public startUsingBattery ( ) : void
Результат void

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

Stops the supplying energy.
public stopSupplyingEnergy ( ) : void
Результат void

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

Stops the using battery.
public stopUsingBattery ( ) : void
Результат void

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

public toggleSupplyingEnergy ( ) : void
Результат void

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

for when a button in the ui has to toggle this that way this method auto sets whatever button it was. Hopefully that button is linked to the proper EUO. Oh well.
public toggleSupplyingEnergy ( Button sender ) : void
sender Button Sender.
Результат void