aboutsummaryrefslogtreecommitdiff
path: root/gamemode/server/test
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-07-10 17:04:29 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-07-10 17:04:29 -0400
commit1de5f9ac6f038bfed2230cc1272b253794b2f41a (patch)
tree15bc9d515f1f48c036522afb7cc71f60243849a9 /gamemode/server/test
downloadartery-1de5f9ac6f038bfed2230cc1272b253794b2f41a.tar.gz
artery-1de5f9ac6f038bfed2230cc1272b253794b2f41a.tar.bz2
artery-1de5f9ac6f038bfed2230cc1272b253794b2f41a.zip
Initial commit
Diffstat (limited to 'gamemode/server/test')
-rw-r--r--gamemode/server/test/testfile.lua48
1 files changed, 48 insertions, 0 deletions
diff --git a/gamemode/server/test/testfile.lua b/gamemode/server/test/testfile.lua
new file mode 100644
index 0000000..95e40fa
--- /dev/null
+++ b/gamemode/server/test/testfile.lua
@@ -0,0 +1,48 @@
+--print("This is a test file to see if it gets included! Test!")
+--Msg("Testing heatmap.lua\n")
+local hm = heatmap.CreateHeatMap()
+--PrintTable(hm)
+--PrintTable(heatmap)
+--local effect = heatmap.UniformInfiniteForever(5)
+--hm:RegisterEffect(effect,Vector(0,0,0))
+--PrintTable(hm)
+--local neweffect = heatmap.LinearInfiniteForeverGrounded(2000,Vector(0,0,0))
+--hm:RegisterEffect(neweffect,Vector(0,0,0))
+--PrintTable(hm)
+local decayeffect =
+heatmap.LinearInfiniteLinearDecayGrounded(2000,5)
+hm:RegisterEffect(decayeffect,Vector(4000,4000,0))
+local bubbleeffect = heatmap.ParabolicInfiniteForeverGrounded(1000,2.5)
+hm:RegisterEffect(bubbleeffect,Vector(0,0,0))
+
+function sendHeatMap(ply)
+ local points = {}
+ net.Start("showheatmap")
+ for i=0,10000,100 do
+ points[i] = {}
+ for j=0,10000,100 do
+ local offset = --[[ply:GetPos() + ]]Vector(i,j,0) + Vector(-5000,-5000,0)
+ points[i][j] = hm:CalculateFor(offset, 0)
+ --net.WriteVector(offset)
+ net.WriteFloat(points[i][j])
+ --print("at ("..i..","..j..") is ")
+ --print(points[i][j])
+ end
+ end
+ net.Send(ply)
+end
+
+function callloop(ply)
+ sendHeatMap(ply)
+ hm.curtime = hm.curtime + 0.5
+ timer.Simple(0.5,function() callloop(ply) end)
+end
+
+util.AddNetworkString("showheatmap")
+concommand.Add("ShowHeatMap",function(ply,cmd,args)
+ callloop(ply)
+end)
+
+concommand.Add("HeatMapAt",function(ply,cmd,args)
+ print(hm:CalculateFor(ply:GetPos(),0))
+end)