util = require("util") -- Halls run from one point to another, the start and end points are in the -- middle of the hallway. -- "floor_gen" can be a string (the sprites texture to use)a -- or a function (passed the "Hall" object to generate the texture for that segment. class Hall new: (tbl) => util.typecheck(tbl, "startx", "number", "starty", "number", "endx", "number", "endy", "number", "width", "number" ) assert(tbl.floor_gen, "Hall requires a 'floor_gen' attribute") if type(tbl.floor_gen) == "function" @floor_gen = tbl.floor_gen elseif type(tbl.floor_gen) == "string" @floor_gen = () => tbl.floor_gen