Class SportDeviceNotUsedState
- java.lang.Object
-
- cz.cvut.fel.omo.SmartHome.devices.AbstractState
-
- cz.cvut.fel.omo.SmartHome.devices.action.states.AbstractActionDeviceState
-
- cz.cvut.fel.omo.SmartHome.devices.action.states.SportDeviceNotUsedState
-
public class SportDeviceNotUsedState extends AbstractActionDeviceState
The class implements the sport device logic in the not used state.
-
-
Constructor Summary
Constructors Constructor Description SportDeviceNotUsedState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
action(AbstractActionDevice deviceUsable, Creature person)
The method implemented by the state pattern.void
consume(AbstractDevice device)
Method calculating consuming of device.boolean
isFree()
The method determines if the device is not occupied by any person.
-
-
-
Method Detail
-
action
public void action(AbstractActionDevice deviceUsable, Creature person)
Description copied from class:AbstractActionDeviceState
The method implemented by the state pattern. Depending on the state of the device, a different interaction of the device with a person is performed.- Specified by:
action
in classAbstractActionDeviceState
- Parameters:
deviceUsable
- Device with which a person interacts.person
- A person who interacts with device.
-
isFree
public boolean isFree()
Description copied from class:AbstractActionDeviceState
The method determines if the device is not occupied by any person.- Specified by:
isFree
in classAbstractActionDeviceState
- Returns:
-
consume
public void consume(AbstractDevice device)
Description copied from class:AbstractState
Method calculating consuming of device.- Specified by:
consume
in classAbstractState
-
-