Skip to content

Instantly share code, notes, and snippets.

@Raynos
Forked from robotlolita/gist:1174881
Created September 7, 2011 14:20
Show Gist options
  • Save Raynos/1200687 to your computer and use it in GitHub Desktop.
Save Raynos/1200687 to your computer and use it in GitHub Desktop.
Constructors
var Mage = {
cast: function _cast() {
console.log(this.name + ' cast ' + magic);
}
};
var BlackMage = {
fira: function _fira() { this.cast('fira') },
watera: function _watera() { this.cast('watera') }
blizarra: function _blizarra(){ this.cast('blizarra') }
};
// pd - https://github.com/Raynos/pd
var mage = createMage = function _createMage(name) {
return Object.create(Mage, pd({
name: name,
job: 'Mage'
});
};
var blackMage = createblackMage = function _createBlackMage(name) {
return Object.create(pd.merge(Mage, BlackMage), pd({
name: name,
job: 'BlackMage'
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment