From 9695c3ef3a83c06c9ce14709d3237904d0344e5b Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 9 Jan 2007 21:23:38 +0000 Subject: [PATCH] Moved default field deserialization code into separate method to allow subclasses to read additional fields. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@142 c613c5cb-e716-0410-b11b-feb51c14d237 --- src/as/com/threerings/ezgame/data/EZGameObject.as | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/as/com/threerings/ezgame/data/EZGameObject.as b/src/as/com/threerings/ezgame/data/EZGameObject.as index 77b0710c..b5757b3a 100644 --- a/src/as/com/threerings/ezgame/data/EZGameObject.as +++ b/src/as/com/threerings/ezgame/data/EZGameObject.as @@ -141,9 +141,7 @@ public class EZGameObject extends GameObject super.readObject(ins); // first read any regular bits - turnHolder = (ins.readObject() as Name); - userCookies = (ins.readObject() as DSet); - ezGameService = (ins.readObject() as EZGameMarshaller); + readDefaultFields(ins); // then user properties var count :int = ins.readInt(); @@ -154,6 +152,16 @@ public class EZGameObject extends GameObject } } + /** + * Reads the fields written by the default serializer for this instance. + */ + protected function readDefaultFields (ins :ObjectInputStream) :void + { + turnHolder = (ins.readObject() as Name); + userCookies = (ins.readObject() as DSet); + ezGameService = (ins.readObject() as EZGameMarshaller); + } + /** The raw properties set by the game. */ protected var _props :Object = new Object(); }