2014-10-05 16:23:52 +02:00
|
|
|
/*****************************************************************************
|
2019-03-17 08:16:15 +01:00
|
|
|
* Copyright (c) 2014-2019 OpenRCT2 developers
|
2014-10-05 16:23:52 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2014-10-05 16:23:52 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2014-10-05 16:23:52 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2017-10-11 21:38:26 +02:00
|
|
|
#pragma once
|
2014-10-05 16:23:52 +02:00
|
|
|
|
2014-10-07 20:10:16 +02:00
|
|
|
#include "../common.h"
|
2020-01-22 20:51:40 +01:00
|
|
|
#include "../core/Optional.hpp"
|
2018-01-02 20:31:48 +01:00
|
|
|
#include "../object/ObjectLimits.h"
|
|
|
|
#include "../ride/Ride.h"
|
2017-10-19 10:01:05 +02:00
|
|
|
|
2018-02-14 09:42:26 +01:00
|
|
|
struct rct_ride_entry;
|
2014-10-07 20:10:16 +02:00
|
|
|
|
2019-06-16 21:21:06 +02:00
|
|
|
struct ResearchItem
|
2018-01-04 16:43:55 +01:00
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
// Bit 16 (0: scenery entry, 1: ride entry)
|
2018-01-04 16:43:55 +01:00
|
|
|
union
|
|
|
|
{
|
2018-06-20 17:28:51 +02:00
|
|
|
int32_t rawValue;
|
2018-01-04 16:43:55 +01:00
|
|
|
struct
|
|
|
|
{
|
2018-06-20 17:28:51 +02:00
|
|
|
uint8_t entryIndex;
|
|
|
|
uint8_t baseRideType;
|
|
|
|
uint8_t type; // 0: scenery entry, 1: ride entry
|
|
|
|
uint8_t flags;
|
2018-01-04 16:43:55 +01:00
|
|
|
};
|
|
|
|
};
|
2018-06-20 17:28:51 +02:00
|
|
|
uint8_t category;
|
2018-06-15 12:11:03 +02:00
|
|
|
|
|
|
|
bool IsInventedEndMarker() const;
|
2019-06-16 23:32:31 +02:00
|
|
|
bool Equals(const ResearchItem* otherItem) const;
|
|
|
|
bool Exists() const;
|
2020-01-22 22:51:11 +01:00
|
|
|
bool IsAlwaysResearched() const;
|
|
|
|
rct_string_id GetName() const;
|
2018-02-14 09:42:26 +01:00
|
|
|
};
|
2014-10-08 00:42:17 +02:00
|
|
|
|
2018-01-04 16:43:55 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
RESEARCH_ENTRY_TYPE_SCENERY = 0,
|
2018-06-22 23:02:14 +02:00
|
|
|
RESEARCH_ENTRY_TYPE_RIDE = 1,
|
2018-01-04 16:43:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
RESEARCH_ENTRY_FLAG_SCENERY_SET_ALWAYS_RESEARCHED = (1 << 5),
|
|
|
|
RESEARCH_ENTRY_FLAG_RIDE_ALWAYS_RESEARCHED = (1 << 6),
|
2015-06-06 21:07:27 +02:00
|
|
|
};
|
|
|
|
|
2015-06-06 14:25:26 +02:00
|
|
|
// Everything before this point has been researched
|
2018-06-15 10:54:05 +02:00
|
|
|
#define RESEARCHED_ITEMS_SEPARATOR (-1)
|
2015-06-24 12:41:19 +02:00
|
|
|
// Everything before this point and after separator still requires research
|
2018-06-15 10:54:05 +02:00
|
|
|
#define RESEARCHED_ITEMS_END (-2)
|
2018-01-10 13:55:30 +01:00
|
|
|
// Extra end of list entry. Leftover from RCT1.
|
2018-06-15 10:54:05 +02:00
|
|
|
#define RESEARCHED_ITEMS_END_2 (-3)
|
2014-10-08 00:42:17 +02:00
|
|
|
|
2018-06-22 23:02:14 +02:00
|
|
|
#define MAX_RESEARCH_ITEMS 500
|
|
|
|
#define MAX_RESEARCHED_TRACK_TYPES 128
|
2018-01-10 13:55:30 +01:00
|
|
|
#define MAX_RESEARCHED_SCENERY_ITEMS 1792
|
2017-06-03 23:21:47 +02:00
|
|
|
|
2017-09-28 12:31:24 +02:00
|
|
|
#define RESEARCH_ENTRY_RIDE_MASK 0x10000
|
|
|
|
|
2018-06-22 23:02:14 +02:00
|
|
|
enum
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
RESEARCH_FUNDING_NONE,
|
|
|
|
RESEARCH_FUNDING_MINIMUM,
|
|
|
|
RESEARCH_FUNDING_NORMAL,
|
2017-10-06 22:37:06 +02:00
|
|
|
RESEARCH_FUNDING_MAXIMUM,
|
|
|
|
|
|
|
|
RESEARCH_FUNDING_COUNT
|
2014-10-05 18:53:08 +02:00
|
|
|
};
|
|
|
|
|
2018-06-22 23:02:14 +02:00
|
|
|
enum
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
RESEARCH_STAGE_INITIAL_RESEARCH,
|
|
|
|
RESEARCH_STAGE_DESIGNING,
|
|
|
|
RESEARCH_STAGE_COMPLETING_DESIGN,
|
|
|
|
RESEARCH_STAGE_UNKNOWN,
|
|
|
|
RESEARCH_STAGE_FINISHED_ALL
|
2014-10-05 16:23:52 +02:00
|
|
|
};
|
|
|
|
|
2018-06-22 23:02:14 +02:00
|
|
|
enum
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
RESEARCH_CATEGORY_TRANSPORT,
|
|
|
|
RESEARCH_CATEGORY_GENTLE,
|
|
|
|
RESEARCH_CATEGORY_ROLLERCOASTER,
|
|
|
|
RESEARCH_CATEGORY_THRILL,
|
|
|
|
RESEARCH_CATEGORY_WATER,
|
|
|
|
RESEARCH_CATEGORY_SHOP,
|
2018-01-28 16:14:00 +01:00
|
|
|
RESEARCH_CATEGORY_SCENERY_GROUP
|
2015-03-31 18:09:16 +02:00
|
|
|
};
|
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
extern uint8_t gResearchFundingLevel;
|
|
|
|
extern uint8_t gResearchPriorities;
|
|
|
|
extern uint16_t gResearchProgress;
|
|
|
|
extern uint8_t gResearchProgressStage;
|
|
|
|
extern uint8_t gResearchExpectedMonth;
|
|
|
|
extern uint8_t gResearchExpectedDay;
|
2020-01-22 20:51:40 +01:00
|
|
|
extern std::optional<ResearchItem> gResearchLastItem;
|
|
|
|
extern std::optional<ResearchItem> gResearchNextItem;
|
2016-04-26 00:26:26 +02:00
|
|
|
|
2019-06-16 23:32:31 +02:00
|
|
|
extern std::vector<ResearchItem> gResearchItemsUninvented;
|
|
|
|
extern std::vector<ResearchItem> gResearchItemsInvented;
|
2018-06-20 17:28:51 +02:00
|
|
|
extern uint8_t gResearchUncompletedCategories;
|
2015-05-23 20:56:54 +02:00
|
|
|
extern bool gSilentResearch;
|
2014-10-05 20:18:36 +02:00
|
|
|
|
2014-10-08 23:11:50 +02:00
|
|
|
void research_reset_items();
|
2014-10-05 20:18:36 +02:00
|
|
|
void research_update_uncompleted_types();
|
2014-10-05 16:23:52 +02:00
|
|
|
void research_update();
|
2017-06-02 02:40:17 +02:00
|
|
|
void research_reset_current_item();
|
2015-03-31 18:09:16 +02:00
|
|
|
void research_populate_list_random();
|
2015-05-23 20:56:54 +02:00
|
|
|
void research_populate_list_researched();
|
2014-10-05 16:23:52 +02:00
|
|
|
|
2019-06-16 21:21:06 +02:00
|
|
|
void research_finish_item(ResearchItem* researchItem);
|
2018-06-20 17:28:51 +02:00
|
|
|
void research_insert(int32_t researched, int32_t rawValue, uint8_t category);
|
2019-06-16 21:21:06 +02:00
|
|
|
void research_remove(ResearchItem* researchItem);
|
2015-01-24 19:41:55 +01:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
void research_insert_ride_entry(uint8_t entryIndex, bool researched);
|
|
|
|
void research_insert_scenery_group_entry(uint8_t entryIndex, bool researched);
|
|
|
|
|
|
|
|
void ride_type_set_invented(uint32_t rideType);
|
|
|
|
void ride_entry_set_invented(int32_t rideEntryIndex);
|
|
|
|
void scenery_set_invented(uint16_t sceneryItem);
|
|
|
|
void scenery_set_not_invented(uint16_t sceneryItem);
|
|
|
|
bool ride_type_is_invented(uint32_t rideType);
|
|
|
|
bool ride_entry_is_invented(int32_t rideEntryIndex);
|
|
|
|
bool track_piece_is_available_for_ride_type(uint8_t rideType, int32_t trackType);
|
|
|
|
bool scenery_group_is_invented(int32_t sgIndex);
|
|
|
|
void scenery_group_set_invented(int32_t sgIndex);
|
|
|
|
bool scenery_is_invented(uint16_t sceneryItem);
|
2018-01-02 20:31:48 +01:00
|
|
|
void set_all_scenery_items_invented();
|
2018-01-10 13:55:30 +01:00
|
|
|
void set_all_scenery_items_not_invented();
|
2018-01-28 18:27:23 +01:00
|
|
|
void set_all_scenery_groups_not_invented();
|
2018-01-10 12:40:50 +01:00
|
|
|
void set_every_ride_type_invented();
|
|
|
|
void set_every_ride_type_not_invented();
|
2018-01-02 20:31:48 +01:00
|
|
|
void set_every_ride_entry_invented();
|
|
|
|
void set_every_ride_entry_not_invented();
|
2017-09-28 12:31:24 +02:00
|
|
|
void research_remove_flags();
|
2018-01-02 19:40:08 +01:00
|
|
|
void research_fix();
|
2016-05-10 01:00:59 +02:00
|
|
|
|
2018-01-10 15:10:18 +01:00
|
|
|
void research_items_make_all_unresearched();
|
|
|
|
void research_items_make_all_researched();
|
|
|
|
void research_items_shuffle();
|