25 lines
875 B
Lua
25 lines
875 B
Lua
--- @class MapLogic
|
|
--- @field id Id
|
|
--- @field position Vec3
|
|
--- @field runTarget Vec3 точка, в которую в данный момент бежит персонаж
|
|
--- @field displayedPosition Vec3 точка, в которой персонаж отображается
|
|
--- @field t0 number время начала движения для анимациии
|
|
--- @field path Deque путь, по которому сейчас бежит персонаж
|
|
--- @field size Vec3
|
|
local mapLogic = {}
|
|
|
|
--- @param id Id
|
|
--- @param position? Vec3
|
|
--- @param size? Vec3
|
|
local function new(id, position, size)
|
|
return setmetatable({
|
|
id = id,
|
|
position = position or Vec3({}),
|
|
displayedPosition = position or Vec3({}),
|
|
size = size or Vec3({ 1, 1 }),
|
|
path = (require "lib.utils.deque").new()
|
|
}, mapLogic)
|
|
end
|
|
|
|
return { new = new }
|