Package zombie.radio.devices
Class DeviceData
java.lang.Object
zombie.radio.devices.DeviceData
- All Implemented Interfaces:
java.lang.Cloneable
public class DeviceData
extends java.lang.Object
implements java.lang.Cloneable
-
Field Summary
Fields Modifier and Type Field Description protected float
baseVolumeRange
protected int
channel
protected boolean
channelChangedRecently
protected java.lang.String
deviceName
protected float
deviceVolume
protected BaseSoundEmitter
emitter
protected GameTime
gameTime
protected boolean
hasBattery
protected int
headphoneType
protected boolean
isBatteryPowered
protected boolean
isHighTier
protected boolean
isPortable
protected boolean
isTelevision
protected boolean
isTurnedOn
protected long
lastMinuteStamp
protected int
lastRecordedDistance
protected int
listenCnt
protected int
maxChannelRange
protected boolean
micIsMuted
protected int
micRange
protected int
minChannelRange
protected WaveSignalDevice
parent
protected float
powerDelta
protected DevicePresets
presets
protected long
radioLoopSound
protected float
signalCounter
protected float
soundCounter
protected java.util.ArrayList
soundIDs
protected int
transmitRange
protected boolean
twoWay
protected float
useDelta
-
Constructor Summary
Constructors Constructor Description DeviceData()
DeviceData(WaveSignalDevice parent)
-
Method Summary
Modifier and Type Method Description void
addBattery(DrainableComboItem bat)
void
addHeadphones(InventoryItem headphones)
boolean
canBePoweredHere()
void
cleanSoundsAndEmitter()
protected java.lang.Object
clone()
void
doReceiveSignal(int distance)
void
generatePresets()
float
getBaseVolumeRange()
InventoryItem
getBattery(ItemContainer inventory)
int
getChannel()
DeviceData
getClone()
java.lang.String
getDeviceName()
DevicePresets
getDevicePresets()
int
getDeviceSoundVolumeRange()
float
getDeviceVolume()
int
getDeviceVolumeRange()
boolean
getHasBattery()
InventoryItem
getHeadphones(ItemContainer inventory)
int
getHeadphoneType()
boolean
getIsBatteryPowered()
boolean
getIsHighTier()
boolean
getIsPortable()
boolean
getIsTelevision()
boolean
getIsTurnedOn()
boolean
getIsTwoWay()
int
getLastRecordedDistance()
int
getMaxChannelRange()
boolean
getMicIsMuted()
int
getMicRange()
int
getMinChannelRange()
WaveSignalDevice
getParent()
float
getPower()
int
getTransmitRange()
float
getUseDelta()
boolean
isInventoryDevice()
boolean
isIsoDevice()
boolean
isReceivingSignal()
void
load(java.nio.ByteBuffer input, int WorldVersion, boolean net)
void
playSound(java.lang.String soundname, boolean useDeviceVolume)
void
playSound(java.lang.String soundname, float volume)
void
receiveDeviceDataStatePacket(java.nio.ByteBuffer bb, UdpConnection ignoreConnection)
void
save(java.nio.ByteBuffer output, boolean net)
void
setBaseVolumeRange(float f)
void
setChannel(int c)
void
setChannel(int chan, boolean setislistening)
void
setDeviceName(java.lang.String name)
void
setDevicePresets(DevicePresets p)
void
setDeviceVolume(float f)
protected void
setEmitterAndPos()
void
setHasBattery(boolean b)
void
setHeadphoneType(int i)
void
setIsBatteryPowered(boolean b)
void
setIsHighTier(boolean b)
void
setIsPortable(boolean b)
void
setIsTelevision(boolean b)
void
setIsTurnedOn(boolean b)
void
setIsTwoWay(boolean b)
void
setMaxChannelRange(int i)
void
setMicIsMuted(boolean b)
void
setMicRange(int i)
void
setMinChannelRange(int i)
void
setParent(WaveSignalDevice p)
void
setPower(float p)
void
setRandomChannel()
void
setTransmitRange(int range)
void
setTurnedOnRaw(boolean b)
void
setUseDelta(float f)
void
transmitBattryChange()
void
transmitPresets()
void
TriggerPlayerListening(boolean listening)
void
update(boolean isIso, boolean playerInRange)
protected void
updateEmitter()
void
updateSimple()
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
deviceName
protected java.lang.String deviceName -
twoWay
protected boolean twoWay -
transmitRange
protected int transmitRange -
micRange
protected int micRange -
micIsMuted
protected boolean micIsMuted -
baseVolumeRange
protected float baseVolumeRange -
deviceVolume
protected float deviceVolume -
isPortable
protected boolean isPortable -
isTelevision
protected boolean isTelevision -
isHighTier
protected boolean isHighTier -
isTurnedOn
protected boolean isTurnedOn -
channel
protected int channel -
minChannelRange
protected int minChannelRange -
maxChannelRange
protected int maxChannelRange -
presets
-
isBatteryPowered
protected boolean isBatteryPowered -
hasBattery
protected boolean hasBattery -
powerDelta
protected float powerDelta -
useDelta
protected float useDelta -
lastRecordedDistance
protected int lastRecordedDistance -
headphoneType
protected int headphoneType -
parent
-
gameTime
-
channelChangedRecently
protected boolean channelChangedRecently -
emitter
-
soundIDs
protected java.util.ArrayList soundIDs -
radioLoopSound
protected long radioLoopSound -
lastMinuteStamp
protected long lastMinuteStamp -
listenCnt
protected int listenCnt -
signalCounter
protected float signalCounter -
soundCounter
protected float soundCounter
-
-
Constructor Details
-
DeviceData
public DeviceData() -
DeviceData
-
-
Method Details
-
generatePresets
public void generatePresets() -
clone
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
getClone
-
getParent
-
setParent
-
getDevicePresets
-
setDevicePresets
-
getMinChannelRange
public int getMinChannelRange() -
setMinChannelRange
public void setMinChannelRange(int i) -
getMaxChannelRange
public int getMaxChannelRange() -
setMaxChannelRange
public void setMaxChannelRange(int i) -
getIsHighTier
public boolean getIsHighTier() -
setIsHighTier
public void setIsHighTier(boolean b) -
getIsBatteryPowered
public boolean getIsBatteryPowered() -
setIsBatteryPowered
public void setIsBatteryPowered(boolean b) -
getHasBattery
public boolean getHasBattery() -
setHasBattery
public void setHasBattery(boolean b) -
addBattery
-
getBattery
-
transmitBattryChange
public void transmitBattryChange() -
addHeadphones
-
getHeadphones
-
getMicRange
public int getMicRange() -
setMicRange
public void setMicRange(int i) -
getMicIsMuted
public boolean getMicIsMuted() -
setMicIsMuted
public void setMicIsMuted(boolean b) -
getHeadphoneType
public int getHeadphoneType() -
setHeadphoneType
public void setHeadphoneType(int i) -
getBaseVolumeRange
public float getBaseVolumeRange() -
setBaseVolumeRange
public void setBaseVolumeRange(float f) -
getDeviceVolume
public float getDeviceVolume() -
setDeviceVolume
public void setDeviceVolume(float f) -
getIsTelevision
public boolean getIsTelevision() -
setIsTelevision
public void setIsTelevision(boolean b) -
getDeviceName
public java.lang.String getDeviceName() -
setDeviceName
public void setDeviceName(java.lang.String name) -
getIsTwoWay
public boolean getIsTwoWay() -
setIsTwoWay
public void setIsTwoWay(boolean b) -
getTransmitRange
public int getTransmitRange() -
setTransmitRange
public void setTransmitRange(int range) -
getIsPortable
public boolean getIsPortable() -
setIsPortable
public void setIsPortable(boolean b) -
getIsTurnedOn
public boolean getIsTurnedOn() -
setIsTurnedOn
public void setIsTurnedOn(boolean b) -
setTurnedOnRaw
public void setTurnedOnRaw(boolean b) -
canBePoweredHere
public boolean canBePoweredHere() -
setRandomChannel
public void setRandomChannel() -
getChannel
public int getChannel() -
setChannel
public void setChannel(int c) -
setChannel
public void setChannel(int chan, boolean setislistening) -
getUseDelta
public float getUseDelta() -
setUseDelta
public void setUseDelta(float f) -
getPower
public float getPower() -
setPower
public void setPower(float p) -
TriggerPlayerListening
public void TriggerPlayerListening(boolean listening) -
playSound
public void playSound(java.lang.String soundname, boolean useDeviceVolume) -
playSound
public void playSound(java.lang.String soundname, float volume) -
cleanSoundsAndEmitter
public void cleanSoundsAndEmitter() -
setEmitterAndPos
protected void setEmitterAndPos() -
updateEmitter
protected void updateEmitter() -
update
public void update(boolean isIso, boolean playerInRange) -
updateSimple
public void updateSimple() -
getDeviceVolumeRange
public int getDeviceVolumeRange() -
getDeviceSoundVolumeRange
public int getDeviceSoundVolumeRange() -
doReceiveSignal
public void doReceiveSignal(int distance) -
isReceivingSignal
public boolean isReceivingSignal() -
getLastRecordedDistance
public int getLastRecordedDistance() -
isIsoDevice
public boolean isIsoDevice() -
isInventoryDevice
public boolean isInventoryDevice() -
transmitPresets
public void transmitPresets() -
receiveDeviceDataStatePacket
public void receiveDeviceDataStatePacket(java.nio.ByteBuffer bb, UdpConnection ignoreConnection) throws java.io.IOException- Throws:
java.io.IOException
-
save
public void save(java.nio.ByteBuffer output, boolean net) throws java.io.IOException- Throws:
java.io.IOException
-
load
public void load(java.nio.ByteBuffer input, int WorldVersion, boolean net) throws java.io.IOException- Throws:
java.io.IOException
-