Changes between Version 5 and Version 6 of Java Client Tutorial


Ignore:
Timestamp:
Oct 23, 2011 1:51:55 PM (13 years ago)
Author:
jherwitz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Java Client Tutorial

    v5 v6  
    193193}}}
    194194
    195 
     195 * A ''run'' function, which acts as a black-box executor for external processes.
    196196
    197197For more information, see the CartesianSensor2D source, as well as its implementation in the CaveExplorer class.
     
    199199==== Implementing a new Entity ====
    200200
     201All entities must implement the same functions.
     202 * A ''getWriter'' function which returns the entity's socket writer.
     203 * A ''waitForTerminate'' function which blocks until server response.
     204 * An ''execute'' function which executes a command and blocks until server response.
     205 * A ''start'' command which executes a command but does '''not''' block for server response.
     206 * An ''addEventListener'' command which is fired when a command is returned.
     207 * Several internally-used functions. Many of these are trivial, but necessary for external black-box access. For examples, see the implementation in the Client class.
     208
    201209'''QuagentEntity'''
    202210
     211In addition to the above, the QuagentEntity must implement:
     212 * Another ''addEventListener'' command, which is used to flag significant in-game events, such as death and messages heard.
     213 * A ''getEventListener'', which returns the in-game event listener.
     214 * A ''setQuagentID'', which assigns an integer id to the quagent given by the server
     215 * A ''getQuagentID'', which returns the above.
     216 * The initial phase commands.
     217
    203218'''GODEntity'''
     219
     220The GOD entity must implement all Entity functions, as well as an ''addEventListener'' and a ''getEventListener'' function which is directly analogous to those used for the QuagentEntity (with a different listener type).
     221
     222
     223The Client and GOD classes provide example implementations.