summaryrefslogtreecommitdiff
path: root/Source/Samples/LuaxTest/script.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Samples/LuaxTest/script.lua')
-rw-r--r--Source/Samples/LuaxTest/script.lua19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/Samples/LuaxTest/script.lua b/Source/Samples/LuaxTest/script.lua
index 32bd8e8..97890c0 100644
--- a/Source/Samples/LuaxTest/script.lua
+++ b/Source/Samples/LuaxTest/script.lua
@@ -63,7 +63,24 @@ function main()
return "kid:Write() 2"
end )
print(kid:Speak())
-
+
+------------------- plain class test
+ local Foo = Asura.Class("Foo")
+ Foo.Ctor = function(self, age, name, boy)
+ self.age = age
+ self.name = boy:GetName()
+ self.boy = boy
+ end
+ Foo.GetAge = function(self)
+ return self.age
+ end
+ Foo.GetName = function(self)
+ return self.name
+ end
+ local foo = Foo.New(10, "lee", kid)
+ print(foo:GetName())
+ print(Foo.GetClassName())
+ print(foo.boy:GetAge())
end
function err(msg)
print(msg)