Loading

Revision differences

Old revision #ptw9byi8hNew revision #ptwttkait
1    /**  1    /**  
2     * Given the current selected Company slot and a direction to search,  2     * Given the current selected Company slot and a direction to search,  
3     * get the first free Company slot or INVALID_COMPANY if there's none.  3     * get the first free Company slot that is found.
   4     * @note Returns INVALID_COMPANY if none was found.
   5     * @note A direction must be provided.
4     * @param slot The currently selected Company slot  6     * @param slot The currently selected Company slot  
5     * @param dir The direction to search (-1 to search above, +1 to search below)  7     * @param dir The direction to search (-1 to search above, +1 to search below)  
  8     * @pre (dir == -1 || dir == +1)  
6     * @return the first free CompanyID that is found from the given direction  9     * @return the first free CompanyID that is found from the given direction  
7     * @note returns INVALID_COMPANY if none was found.    
8     */  10     */  
9    static CompanyID GetFreeSlot(CompanyID slot, int dir = 0)  11    static CompanyID GetFreeSlot(CompanyID slot, int dir = 0)  
10    {  12    {