remove type from cell class

This commit is contained in:
Niouby committed 2015-02-23 15:06:55 +01:00
1 parent 4bd2a5d58a
commit 44102bec90
4 files changed
+1 -4

No files matched your search

-1
View File
@@ -3,7 +3,6 @@ AliveCell.__index = AliveCell
function AliveCell.new(n)
local self = setmetatable({}, AliveCell)
self.type = "AliveCell"
return self
end
-1
View File
@@ -3,7 +3,6 @@ Cell.__index = Cell
function Cell.new(n)
local self = setmetatable({}, Cell)
self.type = "Cell"
return self
end
-1
View File
@@ -3,7 +3,6 @@ DeadCell.__index = DeadCell
function DeadCell.new(n)
local self = setmetatable({}, DeadCell)
self.type = "DeadCell"
return self
end
+1 -1
View File
@@ -58,7 +58,7 @@ function World:neighbour(line, column)
and i<self.lines
and j<self.columns
then
if self.grid[i][j].type == "AliveCell" then
if self.grid[i][j].__index == AliveCell then
neighbour=neighbour+1
end
end