21 lines
		
	
	
		
			609 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			609 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
| --- Поведение персонажа. Их можно комбинировать как угодно, добавлять и заменять на лету...
 | |
| --- @class Behavior
 | |
| --- @field id string
 | |
| --- @field owner Character
 | |
| --- @field dependencies Behavior[]
 | |
| --- @field new fun(...) : self
 | |
| --- @field update fun(self, dt): nil
 | |
| --- @field draw fun(self): nil
 | |
| local behavior = {}
 | |
| behavior.__index = behavior
 | |
| behavior.id = "behavior"
 | |
| behavior.dependencies = {}
 | |
| 
 | |
| function behavior.new() return setmetatable({}, behavior) end
 | |
| 
 | |
| function behavior:update(dt) end
 | |
| 
 | |
| function behavior:draw() end
 | |
| 
 | |
| return behavior
 |