Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheffectsHandler.lua
More file actions
Latest commit
59 lines (47 loc) · 1.5 KB
/
Copy patheffectsHandler.lua
File metadata and controls
59 lines (47 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
localIterableMap=require("include/IterableMap")
localutil=require("include/util")
localEffectDefs=util.LoadDefDirectory("effects")
localNewEffect=require("objects/effect")
localself= {}
localapi= {}
functionapi.SpawnEffect(name, pos, data)
localdef=EffectDefs[name]
data=dataor {}
data.pos=pos
ifdef.interfacethen
IterableMap.Add(self.interfaceEffects, NewEffect(data, def))
else
IterableMap.Add(self.worldEffects, NewEffect(data, def))
end
end
functionapi.Update(dt)
IterableMap.ApplySelf(self.worldEffects, "Update", dt)
IterableMap.ApplySelf(self.interfaceEffects, "Update", dt)
end
functionapi.Draw(drawQueue)
localleft, top, right, bot=self.world.GetCameraExtents(200)
--IterableMap.ApplySelf(self.worldEffects, "Draw", drawQueue, left, top, right, bot)
localindexMax, keyByIndex, dataByKey=IterableMap.GetBarbarianData(self.worldEffects)
--print(indexMax)
fori=1, indexMaxdo
dataByKey[keyByIndex[i]].Draw(drawQueue, left, top, right, bot)
end
end
functionapi.DrawInterface()
IterableMap.ApplySelf(self.interfaceEffects, "DrawInterface")
end
functionapi.GetActivity()
returnIterableMap.Count(self.worldEffects)
end
functionapi.GetActivityInterface()
returnIterableMap.Count(self.interfaceEffects)
end
functionapi.Initialize(parentWorld)
self= {
worldEffects=IterableMap.New(),
interfaceEffects=IterableMap.New(),
animationTimer=0,
world=parentWorld,
}
end
returnapi