Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Renderable
- {
- - render();
- }
- class Thing
- {
- name = "unnamed thing";
- size = 0;
- data = null;
- > types = {};
- > __construct()
- {
- this.data = {};
- }
- > rename( name )
- {
- this.name = name;
- }
- - move( pos );
- > create( type )
- {
- found_class = @Thing.types[ type ];
- return new found_class();
- }
- }
- class Box extends Thing implements Renderable
- {
- position = vec3(0,0,0);
- > move( pos )
- {
- this.position = pos;
- }
- > render()
- {
- print "#";
- }
- }
- Thing.types[ "Box" ] = Box;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement