de.farafin.snEADy.world
Class C_World

java.lang.Object
  extended by de.farafin.snEADy.world.C_World
All Implemented Interfaces:
I_Constants, I_PlayFieldConstants, I_World_interface

public final class C_World
extends java.lang.Object
implements I_World_interface, I_Constants, I_PlayFieldConstants

this class contains all calculations of the play field. If something moves or runns against a wall, in world its the place where its calculated.

Version:
$Revision: 1.31 $
Author:
roland, lars

Field Summary
private  C_Arena arena
          arena of the game
private  long lastSDTime
          only one segment per cycle
private  long nextGoodyTime
          next time a goody occures
private  GameParameter parameter
          parameter set of GameParameter
private  java.util.Random randGoody
          computes the kind of goody than should placed
private  java.util.Random randNextGoodyTime
          computes the next time a goody occures
 
Fields inherited from interface de.farafin.snEADy.communication.I_Constants
analyse_ms, auto_grow_delay, auto_slowdown_delay, closemonitor, commandConstants, damage_length_grow, damage_points_radius, DEBUG, delplayer, easy_points, emergencyPause, exit_time, FACE_EAST, FACE_NORTH, FACE_SOUTH, FACE_WEST, goody_length_occ, goody_length_value, goody_points_occ, goody_points_value, goody_shorter_occ, goody_shorter_value, goody_slowdown_occ, goody_speed_occ, IN_ACTION, IN_ERROR_EXC, IN_ERROR_INIT, IN_ERROR_SPACE, IN_ERROR_TIME, IN_EXIT, IN_HEAVEN, init_length, init_move_delay, kill, kill_point_goodies, kill_points_radius, loadhuman, loadlevel, loadplayer, logging, max_goody_occ_delay, MAX_HUMAN_PLAYERS, max_mem_check_delay, max_move_delay, max_player_mem, MAX_PLAYERS, max_thinking_ms, min_cycle_ms, min_move_delay, openmonitor, overalldelay, pause, print_calc_ms, print_parameter, print_player_mem, print_playfield, quit, run, show_subcycles, start, stop, suddend_time, survival_points, timeout_ms, TURN_LEFT, TURN_NONE, TURN_RIGHT
 
Fields inherited from interface de.farafin.snEADy.communication.I_PlayFieldConstants
EXIT, FIELD_B, FIELD_C, FIELD_D, FIELD_E, FIELD_F, FIELD_G, FIELD_H, FIELD_I, FIELD_J, FIELD_K, FIELD_L, FIELD_M, FIELD_N, FIELD_O, FIELD_P, FIELD_Q, FIELD_R, FIELD_S, FIELD_T, FIELD_U, FIELD_V, FIELD_W, FIELD_X, FIELD_Y, FIELD_Z, FREE, GOODY_f, GOODY_g, GOODY_h, GOODY_i, GOODY_j, GOODY_k, GOODY_l, GOODY_m, GOODY_n, GOODY_o, GOODY_p, GOODY_q, GOODY_r, GOODY_s, GOODY_t, GOODY_u, GOODY_v, GOODY_w, GOODY_x, GOODY_y, GOODY_z, LENGTH, PLAYER_0, PLAYER_1, PLAYER_2, PLAYER_3, PLAYER_4, PLAYER_5, PLAYER_6, PLAYER_7, PLAYER_8, PLAYER_9, POINTS, SHORT, SLOW, SPEED, WALL
 
Constructor Summary
C_World(D_GameInfo gameInfo, GameParameter parameter)
          constructor
 
Method Summary
 D_Level generateLevel()
           
private  void placeGoody(D_GameInfo gameInfo)
          sets a new goody and estimates the next goody time
 void update(D_GameInfo gameInfo)
          calculate the new playfield with the informations in gameInfo stores the changed data in gameInfo
 void updateInfos(D_GameInfo gameInfo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arena

private final C_Arena arena
arena of the game


nextGoodyTime

private long nextGoodyTime
next time a goody occures


randNextGoodyTime

private java.util.Random randNextGoodyTime
computes the next time a goody occures


randGoody

private java.util.Random randGoody
computes the kind of goody than should placed


parameter

private final GameParameter parameter
parameter set of GameParameter


lastSDTime

private long lastSDTime
only one segment per cycle

Constructor Detail

C_World

public C_World(D_GameInfo gameInfo,
               GameParameter parameter)
constructor

Parameters:
gameInfo -
Method Detail

placeGoody

private void placeGoody(D_GameInfo gameInfo)
sets a new goody and estimates the next goody time

Parameters:
gameInfo -

update

public void update(D_GameInfo gameInfo)
Description copied from interface: I_World_interface
calculate the new playfield with the informations in gameInfo stores the changed data in gameInfo

Specified by:
update in interface I_World_interface

generateLevel

public D_Level generateLevel()
Specified by:
generateLevel in interface I_World_interface
Returns:
a copy of the contained Level

updateInfos

public void updateInfos(D_GameInfo gameInfo)
Specified by:
updateInfos in interface I_World_interface
Parameters:
gameInfo - a instance the informations should be filled in