summaryrefslogtreecommitdiffstats
path: root/awall/object.lua
blob: a49e96ce1b5875e1275b563aaca7bf5f6cfefe2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--[[
Class model with inheritance and morphing support for Alpine Wall
Copyright (C) 2012 Kaarle Ritvanen
Licensed under the terms of GPL2
]]--


module(..., package.seeall)

function class(base)
   local cls = {}
   local mt = {__index = cls}

   if base then setmetatable(cls, {__index = base}) end

   function cls.new(...) return cls.morph({}, unpack(arg)) end

   function cls:morph(...)
      setmetatable(self, mt)
      self:init(unpack(arg))
      return self
   end

   return cls
end

Object = class()

function Object:init(...) end