想将之前项目当中的javascript原型方法移植到uniapp当中,代码类似于下面这样。
function Game(Player){
this.Player = 1;
}
Game.prototype.makeMove = function(move) {
this.Player = 2;
}
Game.prototype.undoMove = function() {
this.Player = 3;
}
function Small(Player){
this.Player = 2;
}
Small.prototype.makeMove = function(move) {
this.Player = 3;
}
Small.prototype.undoMove= function() {
this.Player = 5;
}
应该如何操作并使用它呢?