Package mazealgo.model.server
Class GenerateMazeStrategy
java.lang.Object
mazealgo.model.server.GenerateMazeStrategy
- All Implemented Interfaces:
IServerStrategy
Server strategy: receives requested maze dimensions as
int[]
{rows, columns}, generates a maze with MyMazeGenerator, and
returns it as a compressed byte array.
Wire protocol:
client ─[ObjectOutputStream]─ int[] dims ─→ server client ←─────── byte[] (RLE-compressed maze) ─── serverCompression uses
MyCompressorOutputStream; the client decodes
via MyDecompressorInputStream and feeds the bytes into the
Maze(byte[]) constructor.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidserverStrategy(InputStream inFromClient, OutputStream outToClient)
-
Constructor Details
-
GenerateMazeStrategy
public GenerateMazeStrategy() -
GenerateMazeStrategy
-
-
Method Details
-
serverStrategy
- Specified by:
serverStrategyin interfaceIServerStrategy- Throws:
Exception
-