Last active
August 29, 2015 14:05
-
-
Save slashman/3c98a4c84510829efac3 to your computer and use it in GitHub Desktop.
Ananias Player serialization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
circular.registerClass('Player', Player, { | |
transients: { | |
gameController: true, | |
sprite: true | |
}, | |
reviver: function(object, reviverData){ | |
object.gameController = reviverData.gameController; | |
var gameController = object.gameController; | |
for (var i = 0; i < object.items.length; i++){ | |
var item = object.items[i]; | |
gameController.addItemToRoom(item); | |
gameController.addItemToInventory(item); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment