Helo,
For my current server setup, I have a three step approach.
The first layer decides the function type being called. I setup an enum in my slice file for this called FUNCTION.
The second layer decides which sector the message is originating from.
The third layer is where the message is actually processed.
Now I have a slice file which has 3 classes atm. The first one is FunctionMessage, and it just contains a var Function func; This will hold the function type.
The second class, SectorMessage, extends the first one and adds a sectorId, which is an int. So far so good.
Now I get to the third class, MovementMessage. Since the MovementMessage is always linked to a particilar FUNCTION, I would like to set the func var right there in the slice file. The MovementMessage extends the SectorMessage, which in turn extends the FunctionMessage. As such, the MovementMessage already has access to the func variable. But for some reason I can't seem to figure out a way to set it right there in the slice file.
I've added what I have so far below:
Code:module com { module ractoc { module test { enum FUNCTION { COMBAT, MOVEMENT, MARKET }; class FunctionMessage { FUNCTION funct; }; class SectorMessage extends FunctionMessage { int sectorId; }; class MovementMessage extends SectorMessage { int speed; }; interface MessageTest { void sendMessage(FunctionMessage msg); }; }; }; };

Reply With Quote
