lib/more_collections & bucketed_game: declare `serialize` at the module level
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 29 May 2015 01:14:24 +0000 (21:14 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 29 May 2015 20:46:04 +0000 (16:46 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/bucketed_game.nit
lib/more_collections.nit

index a621c54..ad79e6c 100644 (file)
 #
 # Allows for fast support of a large number of entities with rare actions,
 # such as a forest with many individual trees.
-module bucketed_game
+module bucketed_game is serialize
 
 import serialization
 
 # Something acting on the game
 class Turnable[G: Game]
-       auto_serializable
 
        # Execute `turn` for this instance.
        fun do_turn(turn: GameTurn[G]) is abstract
@@ -35,7 +34,6 @@ end
 # Something acting on the game from time to time
 class Bucketable[G: Game]
        super Turnable[G]
-       auto_serializable
 
        private var act_at: nullable Int = null
 
@@ -49,7 +47,6 @@ end
 # Optimized organization of `Bucketable` instances
 class Buckets[G: Game]
        super Turnable[G]
-       auto_serializable
 
        # Bucket type used in this implementation.
        type BUCKET: HashSet[Bucketable[G]]
@@ -118,12 +115,10 @@ end
 # Event raised at the first turn
 class FirstTurnEvent
        super GameEvent
-       auto_serializable
 end
 
 # Game logic on the client
 class ThinGame
-       auto_serializable
 
        # Game tick when `self` should act.
        #
@@ -133,7 +128,6 @@ end
 
 # Game turn on the client
 class ThinGameTurn[G: ThinGame]
-       auto_serializable
 
        # Game tick when `self` should act.
        var tick: Int is protected writable
@@ -145,7 +139,6 @@ end
 # Game turn on the full logic
 class GameTurn[G: Game]
        super ThinGameTurn[G]
-       auto_serializable
 
        # Game that `self` belongs to.
        var game: G
@@ -173,7 +166,6 @@ end
 # Full game logic
 class Game
        super ThinGame
-       auto_serializable
 
        # Game type used in this implementation.
        type G: Game
index 4f75430..019dc67 100644 (file)
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # Highly specific, but useful, collections-related classes.
-module more_collections
+module more_collections is serialize
 
 import serialization
 
@@ -32,7 +32,6 @@ import serialization
 #     assert m["four"] == ['i', 'i', 'i', 'i']
 #     assert m["zzz"] == new Array[Char]
 class MultiHashMap[K, V]
-       auto_serializable
        super HashMap[K, Array[V]]
 
        # Add `v` to the array associated with `k`.
@@ -64,7 +63,6 @@ end
 # assert hm2[2, "not-two"] == null
 # ~~~~
 class HashMap2[K1, K2, V]
-       auto_serializable
 
        private var level1 = new HashMap[K1, HashMap[K2, V]]
 
@@ -113,7 +111,6 @@ end
 # assert hm3[2, "not-two", 22] == null
 # ~~~~
 class HashMap3[K1, K2, K3, V]
-       auto_serializable
 
        private var level1 = new HashMap[K1, HashMap2[K2, K3, V]]
 
@@ -193,7 +190,6 @@ end
 # assert dma.default == [65]
 # ~~~~
 class DefaultMap[K, V]
-       auto_serializable
        super HashMap[K, V]
 
        # The default value.