bindings for LEAVE command

This commit is contained in:
Enno Rehling 2012-06-13 23:28:56 -07:00
parent 09800b8387
commit 483615c458
5 changed files with 18 additions and 0 deletions

View File

@ -30,6 +30,7 @@ function test_process()
assert_equal("function", _G.type(eressea.process.study)) assert_equal("function", _G.type(eressea.process.study))
assert_equal("function", _G.type(eressea.process.movement)) assert_equal("function", _G.type(eressea.process.movement))
assert_equal("function", _G.type(eressea.process.use)) assert_equal("function", _G.type(eressea.process.use))
assert_equal("function", _G.type(eressea.process.leave))
end end
function test_settings() function test_settings()

View File

@ -137,8 +137,19 @@ end
function test_process_move() function test_process_move()
r2 = _G.region.create(1, 0, 'plain') r2 = _G.region.create(1, 0, 'plain')
u:add_order('NACH O') u:add_order('NACH O')
assert_not_equal(r2, u.region)
eressea.process.update_long_order() eressea.process.update_long_order()
eressea.process.movement() eressea.process.movement()
assert_equal(r2, u.region) assert_equal(r2, u.region)
end end
function test_process_leave()
r2 = _G.region.create(1, 0, 'plain')
b = _G.building.create(r, "castle")
u.building = b
assert_equal(b, u.building)
u:add_order('VERLASSEN')
eressea.process.leave()
assert_not_equal(b, u.building)
end

View File

@ -146,3 +146,7 @@ void process_movement(void) {
void process_use(void) { void process_use(void) {
process_cmd(K_USE, use_cmd); process_cmd(K_USE, use_cmd);
} }
void process_leave(void) {
process_cmd(K_LEAVE, leave_cmd);
}

View File

@ -21,6 +21,7 @@ void process_quit(void);
void process_study(void); void process_study(void);
void process_movement(void); void process_movement(void);
void process_use(void); void process_use(void);
void process_leave(void);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -18,5 +18,6 @@ module eressea {
void process_study @ study(void); /* LEARN/TEACH */ void process_study @ study(void); /* LEARN/TEACH */
void process_movement @ movement(void); /* MOVE/FOLLOW/ROUTE */ void process_movement @ movement(void); /* MOVE/FOLLOW/ROUTE */
void process_use @ use(void); /* USE */ void process_use @ use(void); /* USE */
void process_leave @ leave(void); /* LEAVE */
} }
} }