Pol  Revision:c08e511
testlos1.cpp
Go to the documentation of this file.
1 
6 // TODO: REWORK ME!!
7 //
8 //#include "testenv.h"
9 //
10 //#include "../clib/logfacility.h"
11 //#include "../pol/uconst.h"
12 //#include "../pol/uobject.h"
13 //#include "../pol/los.h"
14 //#include "../pol/mobile/npc.h"
15 //#include "../pol/item/item.h"
16 //
17 //#include "realm.h"
18 //#include "mapserver.h"
19 // namespace Pol {
20 // namespace Plib {
21 // void inc_successes();
22 // void inc_failures();
23 //
24 // extern Realm* p_test_realm;
25 //
26 // static void test_los( Core::UObject* src, Core::UObject* target, bool should_have_los )
27 // {
28 // if ( p_test_realm == NULL )
29 // p_test_realm = new Realm( "britannia" );
30 //
31 // INFO_PRINT << "LOS test: " << src->name() << " to "
32 // << target->name() << "(" << should_have_los << "):";
33 // bool res = p_test_realm->has_los( *src, *target );
34 // INFO_PRINT << res << " ";
35 // if ( should_have_los == res )
36 // {
37 // INFO_PRINT << "Ok!\n";
38 // inc_successes();
39 // }
40 // else
41 // {
42 // INFO_PRINT << "Failure!\n";
43 // inc_failures();
44 // }
45 //
46 // }
47 //
48 // static void test_los( u16 x1, u16 y1, s8 z1,
49 // u16 x2, u16 y2, s8 z2,
50 // bool should_have_los )
51 // {
52 // if ( p_test_realm == NULL )
53 // p_test_realm = new Realm( "britannia" );
54 //
55 // INFO_PRINT << "LOS test: (" << x1 << "," << y1 << "," << int( z1 ) << ")"
56 // << " - (" << x2 << "," << y2 << "," << int( z2 ) << ")"
57 // << " (" << should_have_los << "):";
58 // bool res = p_test_realm->has_los( Core::LosObj( x1, y1, z1 ), Core::LosObj( x2, y2, z2 ) );
59 // INFO_PRINT << res << " ";
60 // if ( should_have_los == res )
61 // {
62 // INFO_PRINT << "Ok!\n";
63 // inc_successes();
64 // }
65 // else
66 // {
67 // INFO_PRINT << "Failure!\n";
68 // inc_failures();
69 // }
70 //
71 // }
72 // static void test_los( u16 x1, u16 y1, s8 z1, u8 h1,
73 // u16 x2, u16 y2, s8 z2, u8 h2,
74 // bool should_have_los )
75 // {
76 // if ( p_test_realm == NULL )
77 // p_test_realm = new Realm( "britannia" );
78 //
79 // INFO_PRINT << "LOS test: (" << x1 << "," << y1 << "," << int( z1 ) << ",ht=" << int( h1 ) <<
80 // ")"
81 // << " - (" << x2 << "," << y2 << "," << int( z2 ) << ",ht=" << int( h2 ) << ")"
82 // << " (" << should_have_los << "):";
83 // bool res = p_test_realm->has_los( Core::LosObj( x1, y1, z1, h1 ), Core::LosObj( x2, y2, z2,
84 // h2 ) );
85 // INFO_PRINT << res << " ";
86 // if ( should_have_los == res )
87 // {
88 // INFO_PRINT << "Ok!\n";
89 // inc_successes();
90 // }
91 // else
92 // {
93 // INFO_PRINT << "Failure!\n";
94 // inc_failures();
95 // }
96 //
97 // }
98 // void pol_los_test()
99 // {
100 // INFO_PRINT << "POL datafile LOS tests:\n";
101 //
102 // test_los( 5421, 78, 10, 5422, 89, 20, false );
103 // test_los( 1403, 1624, 28, 1402, 1625, 28, true );
104 //
105 // test_los( 1374, 1625, 59, 1379, 1625, 30, true );
106 // test_los( 1373, 1625, 59, 1379, 1625, 30, true );
107 // test_los( 1372, 1625, 59, 1379, 1625, 30, false );
108 // test_los( 1372, 1625, 59, 1381, 1625, 30, true );
109 //
110 // // from you standing in the house in GA to a backpack outside
111 // test_los( 5987, 1999, 7 + 9, 5991, 2001, 1, false );
112 // test_los( 5987, 1999, 7 + 9, 5993, 1997, 1, false );
113 //
114 // // test looking through "black space" in a cave
115 // test_los( 5583, 226, 0, 5590, 223, 0, false );
116 //
117 // test_los( test_banker2, test_chest1, true );
118 // test_los( test_banker2, test_chest2, true );
119 //
120 // // standing aboveground in buc's den, and below
121 //
122 // test_los( test_orclord, test_banker3, false );
123 //
124 // test_los( 579, 2106, 0, 1, 563, 2107, 0, 1, false );
125 // test_los( 862, 1691, 0, 1, 843, 1689, 0, 1, true );
126 // test_los( 1618, 3351, 3, 1, 1618, 3340, 4, 1, true );
127 // }
128 // }
129 //}