de.farafin.snEADy.world
Interface I_World_interface

All Known Implementing Classes:
C_World

public interface I_World_interface

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

Method Summary
 D_Level generateLevel()
           
 void recordGameCycle(D_GameInfo gameInfo)
          computes the record of a game cycle (level + player => recordFile) WARNING there are no control routines if the numbers fit to its range because we do not expact that this could happen in teh game.
 boolean replayGameCycle(D_GameInfo gameInfo, D_PlayerData[] playerData)
          computes the replay of a game cycle (replayFile => level + player)
 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)
           
 

Method Detail

update

void update(D_GameInfo gameInfo)
calculate the new playfield with the informations in gameInfo stores the changed data in gameInfo

Parameters:
gameInfo -

generateLevel

D_Level generateLevel()
Returns:
a copy of the contained Level

updateInfos

void updateInfos(D_GameInfo gameInfo)
Parameters:
gameInfo - a instance the informations should be filled in

recordGameCycle

void recordGameCycle(D_GameInfo gameInfo)
computes the record of a game cycle (level + player => recordFile) WARNING there are no control routines if the numbers fit to its range because we do not expact that this could happen in teh game. If there are later modifications, we strongly recommand to analyse the new game and maybe change the replay/record functions!! reads a record file:

file scheme:
for each gameCycle:
what is stored (consumtion)
- Number bytes (2Byte) (number range: 0x0000 to 0xFFFF)
- Player Nr and status changes (1 Byte)
= Data: (first 4 bit) (number range: 0x10 to 0xF0)
case: 0 - 9 : representation of player number
+ speed changed? (5. bit)
+ length changed? (6. bit)
+ Points changed? (7. bit)
+ Status changed? (8. bit)
case: A: play field changes case: B: gameTime and SDTime changes case: C - F: not used - Nnumber of playfield changes (2Byte) (number range: 0x0000 to 0xFFFF)
- relative Playfield changes (3 Byte each)
y-value (number range: 0x00 to 0xFF)
x-value (number range: 0x00 to 0xFF)
relative char changes: excample: 'a' - '.' (number range: -0x80 to +0x7F)
- playerdata (max 7 Byte)
= speed changes (1 Byte) [only if change bit is 1] (number range: -0x80 to +0x7F)
+ Length changes (2 Byte) [only if change bit is 1] (number range: -0x8000 to +0x7FFF)
+ points changes (2 Byte) [only if change bit is 1] (number range: -0x8000 to +0x7FFF)
+ Status changes (1 Byte) [only if change bit is 1] (number range: -0x80 to +0x7F)
+ head move direction (1 Byte) (number range: 0x00 to 0xFF)
- if player Nr == 11: Exit Time changes (4 Byte) (number range: -0x80000000 to +0x7FFFFFFF) + SDTime changes (4 Byte) (number range: -0x80000000 to +0x7FFFFFFF) = 17 Byte
- Number bytes again (2Byte) (number range: 0x0000 to 0xFFFF)

Parameters:
gameInfo -

replayGameCycle

boolean replayGameCycle(D_GameInfo gameInfo,
                        D_PlayerData[] playerData)
computes the replay of a game cycle (replayFile => level + player)

Parameters:
gameInfo -
playerData -
Returns:
returns true if EOF has reached.
See Also:
updateInfos(de.farafin.snEADy.communication.D_GameInfo)