about summary refs log tree commit diff
path: root/src/game/client/gameclient.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2009-06-15 06:45:44 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2009-06-15 06:45:44 +0000
commit6309d7ad56357e3aecbfeb7096b434a03bdc70a8 (patch)
tree1bf4e300ee2cd13e855c68a6e2160cbc98a06abb /src/game/client/gameclient.cpp
parentbc20e9c433c1c7bd2a9516a936d1d7ffee1e90f2 (diff)
downloadzcatch-6309d7ad56357e3aecbfeb7096b434a03bdc70a8.tar.gz
zcatch-6309d7ad56357e3aecbfeb7096b434a03bdc70a8.zip
continued with localization
Diffstat (limited to 'src/game/client/gameclient.cpp')
-rw-r--r--src/game/client/gameclient.cpp69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp
index 834aa29b..752af7cd 100644
--- a/src/game/client/gameclient.cpp
+++ b/src/game/client/gameclient.cpp
@@ -98,8 +98,77 @@ static void con_serverdummy(void *result, void *user_data)
 	dbg_msg("client", "this command is not available on the client");
 }
 
+#include <base/tl/sorted_array.hpp>
+
 void GAMECLIENT::on_console_init()
 {
+	if(0)
+	{
+		int ints[4] = {0,1,2,3};
+		for(int s = 1; s < 4; s++)
+		{
+			//s = 2;
+			plain_range_sorted<int> test_sorted_range(ints, ints+s);
+			plain_range_sorted<int> res1, res2;
+			
+			//res2 = partition_binary(test_sorted_range, 1);
+		
+			//for(int i = 0; i < 4; i++)
+			//	dbg_assert(partition_linear(test_sorted_range, i).front() == i, "partition linear failed");
+				
+				
+			dbg_msg("", "size %d", s);
+
+			for(int i = -1; i < 5; i++)
+			{
+				res1 = partition_linear(test_sorted_range, i);
+				dbg_msg("", "\tlin %d == %d", i, res1.empty()?-1:res1.front());
+
+				res2 = partition_binary(test_sorted_range, i);
+				dbg_msg("", "\tbin %d == %d", i, res2.empty()?-1:res2.front());
+				//dbg_assert(partition_binary(plain_range_sorted<int>(ints, ints+6), i).front() == i+1, "partition binary failed");
+			}
+		} //*/
+
+		sorted_array<int> test;
+		test.add(4);
+		test.add(1);
+		
+		for(int i = 0; i < 100; i++)
+		{
+			int this_add = rand();
+			test.add(this_add);
+			if(!sort_verify(test.all()))
+			{
+				dbg_msg("", "error inserting %d", this_add);
+				for(sorted_array<int>::range r = test.all(); !r.empty(); r.pop_front())
+					dbg_msg("", "%d", r.front());
+				exit(-1);
+			}
+		}/*
+			
+		
+		test.add(1);
+		test.add(4);
+		test.add(3);
+		test.add(4);
+		test.add(3);
+		test.add(2);
+		//test.insert(1, 1);
+		for(sorted_array<int>::range r = test.all(); !r.empty(); r.pop_front())
+			dbg_msg("", "%d", r.front());
+			*/
+			
+		sort_verify(test.all());
+		/*
+		for(int i = 0; i < 15; i++)
+		{
+			dbg_msg("", "found %d == %d", i, !find_binary(test.all(), i).empty());
+		}*/
+		
+		exit(-1);
+	}
+	
 	// setup pointers
 	binds = &::binds;
 	console = &::console;