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"
|
2018-01-02 20:31:48 +01:00
|
|
|
#include "../object/ObjectLimits.h"
|
|
|
|
#include "../ride/Ride.h"
|
2017-10-19 10:01:05 +02:00
|
|
|
|
2020-02-01 22:11:45 +01:00
|
|
|
#include <optional>
|
|
|
|
|
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
|
|
|
|
{
|
2020-01-26 14:12:57 +01:00
|
|
|
uint32_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
|
|
|
|
2020-01-26 14:12:57 +01:00
|
|
|
bool IsNull() 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;
|
2020-01-26 15:17:37 +01:00
|
|
|
|
|
|
|
ResearchItem() = default;
|
|
|
|
constexpr ResearchItem(uint32_t _rawValue, int32_t _category)
|
|
|
|
: rawValue(_rawValue)
|
|
|
|
, category(_category)
|
|
|
|
{
|
|
|
|
}
|
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
|
|
|
};
|
|
|
|
|
2020-01-26 14:12:57 +01:00
|
|
|
// Only used to mark as null nowadays. Deprecated. TODO: remove.
|
|
|
|
#define RESEARCH_ITEM_NULL 0xFFFFFFFF
|
2014-10-08 00:42:17 +02:00
|
|
|
|
2018-06-22 23:02:14 +02:00
|
|
|
#define MAX_RESEARCH_ITEMS 500
|
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);
|
2020-01-26 15:17:37 +01:00
|
|
|
void research_insert(ResearchItem item, bool researched);
|
2019-06-16 21:21:06 +02:00
|
|
|
void research_remove(ResearchItem* researchItem);
|
2015-01-24 19:41:55 +01:00
|
|
|
|
2020-03-20 19:28:39 +01:00
|
|
|
bool research_insert_ride_entry(uint8_t rideType, ObjectEntryIndex entryIndex, uint8_t category, bool researched);
|
|
|
|
void research_insert_ride_entry(ObjectEntryIndex entryIndex, bool researched);
|
|
|
|
void research_insert_scenery_group_entry(ObjectEntryIndex entryIndex, bool researched);
|
2018-06-20 17:28:51 +02:00
|
|
|
|
|
|
|
void ride_type_set_invented(uint32_t rideType);
|
|
|
|
void ride_entry_set_invented(int32_t rideEntryIndex);
|
2020-03-15 13:28:20 +01:00
|
|
|
void scenery_set_invented(const ScenerySelection& sceneryItem);
|
|
|
|
void scenery_set_not_invented(const ScenerySelection& sceneryItem);
|
2018-06-20 17:28:51 +02:00
|
|
|
bool ride_type_is_invented(uint32_t rideType);
|
|
|
|
bool ride_entry_is_invented(int32_t rideEntryIndex);
|
|
|
|
bool scenery_group_is_invented(int32_t sgIndex);
|
|
|
|
void scenery_group_set_invented(int32_t sgIndex);
|
2020-03-15 13:28:20 +01:00
|
|
|
bool scenery_is_invented(const ScenerySelection& 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();
|