Better way of handling inheriting in javascript.

This commit is contained in:
FrozenCow 2011-01-14 23:38:50 +01:00
parent dfe33efdc3
commit dfc051743d

View File

@ -27,8 +27,7 @@ KzedProjection.prototype = {
}; };
function KzedMapType() {} function KzedMapType() {}
KzedMapType.prototype = { KzedMapType.prototype = $.extend(new DynMapType(), {
__proto__: new DynMapType(),
constructor: KzedMapType, constructor: KzedMapType,
projection: new KzedProjection(), projection: new KzedProjection(),
tileSize: new google.maps.Size(128, 128), tileSize: new google.maps.Size(128, 128),
@ -114,18 +113,18 @@ KzedMapType.prototype = {
} }
return tile.get(0); return tile.get(0);
}, },
}; });
DefaultMapType.prototype = new KzedMapType();
DefaultMapType.prototype.constructor = DefaultMapType;
function DefaultMapType(){} function DefaultMapType(){}
DefaultMapType.prototype.prefix = 't'; DefaultMapType.prototype = $.extend(new KzedMapType(), {
prefix: 't'
});
CaveMapType.prototype = new KzedMapType();
CaveMapType.prototype.constructor = CaveMapType;
function CaveMapType(){} function CaveMapType(){}
CaveMapType.prototype.prefix = 'ct'; CaveMapType.prototype = $.extend(new KzedMapType(), {
prefix: 'ct'
});