tron@2186: /* $Id$ */ tron@2186: belugas@6443: /** @file airport_movement.h Heart of the airports and their finite state machines */ belugas@6443: truelight@0: #ifndef AIRPORT_MOVEMENT_H truelight@0: #define AIRPORT_MOVEMENT_H truelight@0: richk@6715: #include "airport_states.h" truelight@0: truelight@0: // state machine input struct (from external file, etc.) truelight@0: // Finite sTate mAchine --> FTA rubidium@6574: struct AirportFTAbuildup { Darkvater@4842: byte position; // the position that an airplane is at Darkvater@4842: byte heading; // the current orders (eg. TAKEOFF, HANGAR, ENDLANDING, etc.) celestar@6321: uint64 block; // the block this position is on on the airport (st->airport_flags) Darkvater@4842: byte next; // next position from this position rubidium@6574: }; truelight@0: truelight@0: /////////////////////////////////////////////////////////////////////// truelight@0: /////*********Movement Positions on Airports********************/////// richk@6719: richk@6737: static AirportMovingData _airport_moving_data_dummy[] = { rubidium@6769: { 0, 0, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N}, 0, 0 }, rubidium@6769: { 0, 96, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N}, 0, 0 }, rubidium@6769: { 96, 96, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N}, 0, 0 }, rubidium@6769: { 96, 0, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N}, 0, 0 }, richk@4059: }; richk@4059: truelight@0: // Oilrig richk@6737: static AirportMovingData _airport_moving_data_oilrig[9] = { rubidium@6769: { 31, 9, 0, AMED_EXACTPOS, {DIR_NE}, 0, 0 }, // 0 - At oilrig terminal rubidium@6769: { 28, 9, 0, AMED_HELI_RAISE, {DIR_N}, 0, 0 }, // 1 - Take off (play sound) rubidium@6769: { 23, 9, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N}, 0, 0 }, // 2 - In position above landing spot helicopter rubidium@6769: { 23, 9, 0, AMED_HELI_LOWER, {DIR_N}, 0, 0 }, // 3 - Land rubidium@6769: { 28, 9, 0, 0, {DIR_N}, 0, 0 }, // 4 - Goto terminal on ground rubidium@6769: { -31, 69, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N}, 0, 0 }, // 5 - circle #1 (north-east) rubidium@6769: { -31, -49, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N}, 0, 0 }, // 6 - circle #2 (north-west) rubidium@6769: { 69, -49, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N}, 0, 0 }, // 7 - circle #3 (south-west) rubidium@6769: { 69, 9, 0, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N}, 0, 0 }, // 8 - circle #4 (south) truelight@0: }; truelight@0: truelight@0: /////////////////////////////////////////////////////////////////////// truelight@0: /////**********Movement Machine on Airports*********************/////// richk@6737: static byte _airport_entries_dummy[] = {0, 1, 2, 3}; richk@6737: static AirportFTAbuildup _airport_fta_dummy[] = { richk@6719: { 0, 0, 0, 3}, richk@6719: { 1, 0, 0, 0}, richk@6719: { 2, 0, 0, 1}, richk@6719: { 3, 0, 0, 2}, richk@6719: { MAX_ELEMENTS, 0, 0, 0 } // end marker. DO NOT REMOVE richk@6719: }; richk@6719: tron@699: // heliports, oilrigs don't have depots richk@6737: static byte _airport_helipad_heliport_oilrig[] = { 1, 1 }; richk@6737: static byte _airport_entries_heliport_oilrig[] = { 7, 7, 7, 7 }; richk@6737: static AirportFTAbuildup _airport_fta_heliport_oilrig[] = { rubidium@4344: { 0, HELIPAD1, HELIPAD1_block, 1 }, rubidium@4344: { 1, HELITAKEOFF, NOTHING_block, 0 }, // takeoff rubidium@4344: { 2, 255, AIRPORT_BUSY_block, 0 }, { 2, HELILANDING, 0, 3 }, { 2, HELITAKEOFF, 0, 1 }, rubidium@4344: { 3, HELILANDING, AIRPORT_BUSY_block, 4 }, rubidium@4344: { 4, HELIENDLANDING, AIRPORT_BUSY_block, 4 }, { 4, HELIPAD1, HELIPAD1_block, 0 }, { 4, HELITAKEOFF, 0, 2 }, truelight@0: // In Air rubidium@4344: { 5, 0, NOTHING_block, 6 }, rubidium@4344: { 6, 0, NOTHING_block, 7 }, rubidium@4344: { 7, 0, NOTHING_block, 8 }, rubidium@4344: { 8, FLYING, NOTHING_block, 5 }, { 8, HELILANDING, HELIPAD1_block, 2 }, // landing rubidium@4344: { MAX_ELEMENTS, 0, 0, 0 } // end marker. DO NOT REMOVE truelight@0: }; truelight@0: truelight@0: #endif /* AIRPORT_MOVEMENT_H */