net.kolls.railworld.io
Class RWGWriter

java.lang.Object
  extended by net.kolls.railworld.io.RWGWriter

public class RWGWriter
extends java.lang.Object

Saves an in-progress game (position, zoom, selected train, and all trains). It requires the map to go with it

Author:
Steve Kollmansberger

Constructor Summary
RWGWriter()
           
 
Method Summary
static void write(RailSegment[] la, Trains trs, ScriptManager sm, MetaData md, java.io.File f)
          Saves the current game state (trains, dynamic track configuration, visual orientation) to a Rail World Game file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RWGWriter

public RWGWriter()
Method Detail

write

public static void write(RailSegment[] la,
                         Trains trs,
                         ScriptManager sm,
                         MetaData md,
                         java.io.File f)
                  throws java.lang.Exception
Saves the current game state (trains, dynamic track configuration, visual orientation) to a Rail World Game file.

Parameters:
la - Array of rail segments to find both position IDs and track settings
trs - Trains to save
sm - The ScriptManager containing all scripts in use.
md - MetaData with center X and Y, and zoom
f - File to save to
Throws:
java.lang.Exception - If save is unable to proceed, especially if trains is modified while saving