-
-
Save Raynos/1200687 to your computer and use it in GitHub Desktop.
Constructors
This file contains hidden or 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
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