From 6dd6de509ca9ed6d3586f1ab89cd8d72846a0bc4 Mon Sep 17 00:00:00 2001 From: Michal Dziekonski Date: Tue, 15 Dec 2020 01:53:12 +0100 Subject: [PATCH] GH-139 Create helper function to get fleet slots count --- modules/flightControl/_includes.php | 1 + .../helpers/getUserFleetSlotsCount.helper.php | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 modules/flightControl/utils/helpers/getUserFleetSlotsCount.helper.php diff --git a/modules/flightControl/_includes.php b/modules/flightControl/_includes.php index 979365ac2..6ab5a81b8 100644 --- a/modules/flightControl/_includes.php +++ b/modules/flightControl/_includes.php @@ -9,6 +9,7 @@ include($includePath . './utils/helpers/getAvailableHoldTimes.helper.php'); include($includePath . './utils/helpers/getAvailableSpeeds.helper.php'); include($includePath . './utils/helpers/getFleetUnionJoinData.helper.php'); + include($includePath . './utils/helpers/getUserFleetSlotsCount.helper.php'); include($includePath . './utils/validators/fleetArray.validator.php'); include($includePath . './utils/validators/joinUnion.validator.php'); include($includePath . './utils/validators/missionHold.validator.php'); diff --git a/modules/flightControl/utils/helpers/getUserFleetSlotsCount.helper.php b/modules/flightControl/utils/helpers/getUserFleetSlotsCount.helper.php new file mode 100644 index 000000000..23761b801 --- /dev/null +++ b/modules/flightControl/utils/helpers/getUserFleetSlotsCount.helper.php @@ -0,0 +1,28 @@ + $timestamp); + + // return 0; + + return ( + 1 + + $computerTechLevel + + ($isAdmiralActive ? 2 : 0) + ); +} + +?>