Package net.sf.colossus.common
Interface IOptions
- All Known Implementing Classes:
Options
public interface IOptions
Allows getting and setting options.
An attempt to reduce the God-class nature of Client.
- Author:
- David Ripton
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
A callback interface for changes to the options. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(String optname, IOptions.Listener listener) Adds a listener to get callbacks for changes on the specified option.int
getIntOption
(String optname) boolean
boolean
getStringOption
(String optname) void
removeListener
(IOptions.Listener listener) Removes the listener from all options it is subscribed to.void
void
void
-
Method Details
-
addListener
Adds a listener to get callbacks for changes on the specified option. The listener should be called only on true changes, not if an option gets set to the value it has anyway. -
removeListener
Removes the listener from all options it is subscribed to. TODO there is a chance of leakage if classes subscribe to the options but never remove their listeners. -
getOption
-
getOption
-
getStringOption
-
getIntOption
-
setOption
-
setOption
-
setOption
-