コード例 #1
0
ファイル: client.c プロジェクト: teknoa/freeciv-android
JNIEXPORT void JNICALL Java_net_hackcasual_freeciv_NativeHarness_sendNativeCommand
  (JNIEnv * env, jobject obj, jint command) {

	civ_lock();
	switch (command) {
	case COM_GO_TO: key_unit_goto(); break;
	case COM_BUILD_CITY: key_unit_build_city(); break;
	case COM_END_TURN: dsend_packet_player_phase_done(&client.conn, game.info.turn); break;
	case COM_EXPLORE: key_unit_auto_explore(); break;
	case COM_AUTO_WORKER: key_unit_auto_settle(); break;
	case COM_SENTRY: key_unit_sentry(); break;
	case COM_FORTIFY: key_unit_fortify(); break;
	case COM_DISBAND: key_unit_disband(); break;
	case COM_ROAD: key_unit_road(); break;
	case COM_IRRIGATION: key_unit_irrigate(); break;
	case COM_CONNECT_ROAD: key_unit_connect(ACTIVITY_ROAD); break;
	case COM_CONNECT_IRRIGATION: key_unit_connect(ACTIVITY_IRRIGATE); break;
	case COM_CONNECT_RAILROAD: key_unit_connect(ACTIVITY_RAILROAD); break;
	case COM_WAIT: key_unit_wait(); break;
	case COM_BUILD_WONDER: key_unit_build_wonder(); break;
	case COM_TRADE_ROUTE: key_unit_trade_route(); break;
	case COM_MINE: key_unit_mine(); break;
	case COM_TRANSFORM: key_unit_transform(); break;
	case COM_FORTRESS: key_unit_fortress(); break;
	case COM_AIRBASE: key_unit_airbase(); break;
	case COM_POLLUTION: key_unit_pollution(); break;
	case COM_FALLOUT: key_unit_fallout(); break;
	case COM_PARADROP: key_unit_paradrop(); break;
	case COM_PILLAGE: key_unit_pillage(); break;
	case COM_HOMECITY: key_unit_homecity(); break;
	case COM_UNLOAD_TRANSPORT: key_unit_unload_all(); break;
	case COM_LOAD:
		unit_list_iterate(get_units_in_focus(), punit) {
			request_unit_load(punit, NULL);
		} unit_list_iterate_end;
		break;
	case COM_UNLOAD:
	      unit_list_iterate(get_units_in_focus(), punit) {
	    	  request_unit_unload(punit);
	      } unit_list_iterate_end;
コード例 #2
0
static PyObject* python_key_unit_disband(PyObject* self, PyObject* args) {
	if(PyArg_ParseTuple(args, "") == 0) return NULL;
	key_unit_disband();
	return Py_BuildValue("i", 0);
}