2019-08-12 14:16:28 +03:00
|
|
|
//
|
2023-05-24 23:41:23 +03:00
|
|
|
// YaPB, based on PODBot by Markus Klinge ("CountFloyd").
|
|
|
|
|
// Copyright © YaPB Project Developers <yapb@jeefo.net>.
|
2019-08-12 14:16:28 +03:00
|
|
|
//
|
2020-11-03 08:57:12 +03:00
|
|
|
// SPDX-License-Identifier: MIT
|
2019-08-12 14:16:28 +03:00
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2023-05-02 09:42:43 +03:00
|
|
|
constexpr int kMaxNodes = 4096; // max nodes per graph
|
|
|
|
|
constexpr int kMaxNodeLinks = 8; // max links for single node
|
|
|
|
|
|
2019-08-12 14:16:28 +03:00
|
|
|
// defines for nodes flags field (32 bits are available)
|
|
|
|
|
CR_DECLARE_SCOPED_ENUM (NodeFlag,
|
2024-03-11 15:26:11 +03:00
|
|
|
Button = cr::bit (0), // use a nearby button (lifts, doors, etc.)
|
2019-08-12 14:16:28 +03:00
|
|
|
Lift = cr::bit (1), // wait for lift to be down before approaching this node
|
|
|
|
|
Crouch = cr::bit (2), // must crouch to reach this node
|
|
|
|
|
Crossing = cr::bit (3), // a target node
|
|
|
|
|
Goal = cr::bit (4), // mission goal point (bomb, hostage etc.)
|
|
|
|
|
Ladder = cr::bit (5), // node is on ladder
|
|
|
|
|
Rescue = cr::bit (6), // node is a hostage rescue point
|
|
|
|
|
Camp = cr::bit (7), // node is a camping point
|
|
|
|
|
NoHostage = cr::bit (8), // only use this node if no hostage
|
|
|
|
|
DoubleJump = cr::bit (9), // bot help's another bot (requster) to get somewhere (using djump)
|
2020-01-08 18:29:28 +03:00
|
|
|
Narrow = cr::bit (10), // node is inside some small space (corridor or such)
|
2019-08-12 14:16:28 +03:00
|
|
|
Sniper = cr::bit (28), // it's a specific sniper point
|
|
|
|
|
TerroristOnly = cr::bit (29), // it's a specific terrorist point
|
|
|
|
|
CTOnly = cr::bit (30), // it's a specific ct point
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// defines for node connection flags field (16 bits are available)
|
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
|
|
|
CR_DECLARE_SCOPED_ENUM_TYPE (PathFlag, uint16_t,
|
2019-08-12 14:16:28 +03:00
|
|
|
Jump = cr::bit (0) // must jump for this connection
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// enum pathfind search type
|
|
|
|
|
CR_DECLARE_SCOPED_ENUM (FindPath,
|
|
|
|
|
Fast = 0,
|
|
|
|
|
Optimal,
|
|
|
|
|
Safe
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// defines node connection types
|
|
|
|
|
CR_DECLARE_SCOPED_ENUM (PathConnection,
|
|
|
|
|
Outgoing = 0,
|
|
|
|
|
Incoming,
|
2023-05-13 00:19:07 +06:00
|
|
|
Bidirectional,
|
|
|
|
|
Jumping
|
2019-08-12 14:16:28 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// node edit states
|
|
|
|
|
CR_DECLARE_SCOPED_ENUM (GraphEdit,
|
|
|
|
|
On = cr::bit (1),
|
|
|
|
|
Noclip = cr::bit (2),
|
|
|
|
|
Auto = cr::bit (3)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// lift usage states
|
|
|
|
|
CR_DECLARE_SCOPED_ENUM (LiftState,
|
|
|
|
|
None = 0,
|
|
|
|
|
LookingButtonOutside,
|
|
|
|
|
WaitingFor,
|
|
|
|
|
EnteringIn,
|
|
|
|
|
WaitingForTeammates,
|
|
|
|
|
LookingButtonInside,
|
|
|
|
|
TravelingBy,
|
|
|
|
|
Leaving
|
|
|
|
|
)
|
|
|
|
|
|
2021-09-20 13:50:00 +03:00
|
|
|
// node add flags
|
|
|
|
|
CR_DECLARE_SCOPED_ENUM (NodeAddFlag,
|
|
|
|
|
Normal = 0,
|
|
|
|
|
TOnly = 1,
|
|
|
|
|
CTOnly = 2,
|
|
|
|
|
NoHostage = 3,
|
|
|
|
|
Rescue = 4,
|
|
|
|
|
Camp = 5,
|
|
|
|
|
CampEnd = 6,
|
|
|
|
|
JumpStart = 9,
|
|
|
|
|
JumpEnd = 10,
|
|
|
|
|
Goal = 100
|
|
|
|
|
)
|
|
|
|
|
|
2023-05-02 09:42:43 +03:00
|
|
|
CR_DECLARE_SCOPED_ENUM (NotifySound,
|
|
|
|
|
Done = 0,
|
|
|
|
|
Change = 1,
|
|
|
|
|
Added = 2
|
|
|
|
|
)
|
2019-08-12 14:16:28 +03:00
|
|
|
|
2023-05-02 09:42:43 +03:00
|
|
|
#include <vistable.h>
|
2020-02-08 00:03:52 +03:00
|
|
|
|
2023-05-12 22:12:22 +03:00
|
|
|
// general waypoint header information structure for podbot
|
2019-08-12 14:16:28 +03:00
|
|
|
struct PODGraphHeader {
|
2024-11-13 17:52:19 +03:00
|
|
|
char header[8] {};
|
|
|
|
|
int32_t fileVersion {};
|
|
|
|
|
int32_t pointNumber {};
|
|
|
|
|
char mapName[32] {};
|
|
|
|
|
char author[32] {};
|
2019-08-12 14:16:28 +03:00
|
|
|
};
|
|
|
|
|
|
2023-05-12 22:12:22 +03:00
|
|
|
// defines linked nodes
|
2019-08-12 14:16:28 +03:00
|
|
|
struct PathLink {
|
2024-10-27 20:51:37 +03:00
|
|
|
Vector velocity {};
|
|
|
|
|
int32_t distance {};
|
|
|
|
|
uint16_t flags {};
|
|
|
|
|
int16_t index {};
|
2019-08-12 14:16:28 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// define graph path structure for yapb
|
|
|
|
|
struct Path {
|
2024-10-27 20:51:37 +03:00
|
|
|
int32_t number {}, flags {};
|
|
|
|
|
Vector origin {}, start {}, end {};
|
|
|
|
|
float radius {}, light {}, display {};
|
|
|
|
|
PathLink links[kMaxNodeLinks] {};
|
|
|
|
|
PathVis vis {};
|
2019-08-12 14:16:28 +03:00
|
|
|
};
|
|
|
|
|
|
2023-05-12 22:12:22 +03:00
|
|
|
// define waypoint structure for podbot (will convert on load)
|
2019-08-12 14:16:28 +03:00
|
|
|
struct PODPath {
|
2024-11-13 17:52:19 +03:00
|
|
|
int32_t number {}, flags {};
|
|
|
|
|
Vector origin {};
|
|
|
|
|
float radius {}, csx {}, csy {}, cex {}, cey {};
|
|
|
|
|
int16_t index[kMaxNodeLinks] {};
|
|
|
|
|
uint16_t conflags[kMaxNodeLinks] {};
|
|
|
|
|
Vector velocity[kMaxNodeLinks] {};
|
|
|
|
|
int32_t distance[kMaxNodeLinks] {};
|
|
|
|
|
PathVis vis {};
|
2019-08-12 14:16:28 +03:00
|
|
|
};
|
|
|
|
|
|
2023-05-12 22:12:22 +03:00
|
|
|
// general storage header information structure
|
2023-05-02 09:42:43 +03:00
|
|
|
struct StorageHeader {
|
2024-11-13 17:52:19 +03:00
|
|
|
int32_t magic {};
|
|
|
|
|
int32_t version {};
|
|
|
|
|
int32_t options {};
|
|
|
|
|
int32_t length {};
|
|
|
|
|
int32_t compressed {};
|
|
|
|
|
int32_t uncompressed {};
|
2023-05-02 09:42:43 +03:00
|
|
|
};
|
2020-11-23 00:06:18 +03:00
|
|
|
|
2023-05-02 09:42:43 +03:00
|
|
|
// extension header for graph information
|
|
|
|
|
struct ExtenHeader {
|
2024-11-13 17:52:19 +03:00
|
|
|
char author[32] {}; // original author of graph
|
|
|
|
|
int32_t mapSize {}; // bsp size for checksumming map consistency
|
|
|
|
|
char modified[32] {}; // by whom modified
|
2019-08-12 14:16:28 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// graph operation class
|
|
|
|
|
class BotGraph final : public Singleton <BotGraph> {
|
|
|
|
|
public:
|
|
|
|
|
friend class Bot;
|
|
|
|
|
|
|
|
|
|
private:
|
2023-04-02 12:17:12 +03:00
|
|
|
int m_editFlags {};
|
|
|
|
|
int m_cacheNodeIndex {};
|
|
|
|
|
int m_lastJumpNode {};
|
|
|
|
|
int m_findWPIndex {};
|
|
|
|
|
int m_facingAtIndex {};
|
|
|
|
|
int m_autoSaveCount {};
|
|
|
|
|
|
|
|
|
|
float m_timeJumpStarted {};
|
|
|
|
|
float m_autoPathDistance {};
|
|
|
|
|
float m_pathDisplayTime {};
|
|
|
|
|
float m_arrowDisplayTime {};
|
|
|
|
|
|
|
|
|
|
bool m_isOnLadder {};
|
|
|
|
|
bool m_endJumpPoint {};
|
|
|
|
|
bool m_jumpLearnNode {};
|
|
|
|
|
bool m_hasChanged {};
|
|
|
|
|
bool m_narrowChecked {};
|
2023-05-02 09:42:43 +03:00
|
|
|
bool m_silenceMessages {};
|
2023-07-18 15:59:15 +03:00
|
|
|
bool m_lightChecked {};
|
2024-01-30 14:37:14 +03:00
|
|
|
bool m_isOnlineCollected {};
|
2023-04-02 12:17:12 +03:00
|
|
|
|
|
|
|
|
Vector m_learnVelocity {};
|
|
|
|
|
Vector m_learnPosition {};
|
|
|
|
|
Vector m_bombOrigin {};
|
|
|
|
|
Vector m_lastNode {};
|
|
|
|
|
|
|
|
|
|
IntArray m_terrorPoints {};
|
|
|
|
|
IntArray m_ctPoints {};
|
|
|
|
|
IntArray m_goalPoints {};
|
|
|
|
|
IntArray m_campPoints {};
|
|
|
|
|
IntArray m_sniperPoints {};
|
|
|
|
|
IntArray m_rescuePoints {};
|
|
|
|
|
IntArray m_visitedGoals {};
|
2025-01-17 22:43:35 +03:00
|
|
|
IntArray m_nodeNumbers {};
|
2019-08-12 14:16:28 +03:00
|
|
|
|
2023-05-02 09:42:43 +03:00
|
|
|
public:
|
2023-04-02 12:17:12 +03:00
|
|
|
SmallArray <Path> m_paths {};
|
2023-06-20 15:18:35 +03:00
|
|
|
HashMap <int32_t, Array <int32_t>, EmptyHash <int32_t>> m_hashTable {};
|
2023-04-11 22:32:28 +03:00
|
|
|
|
2023-04-02 12:17:12 +03:00
|
|
|
String m_graphAuthor {};
|
|
|
|
|
String m_graphModified {};
|
2022-09-21 14:47:36 +03:00
|
|
|
|
|
|
|
|
ExtenHeader m_extenHeader {};
|
|
|
|
|
StorageHeader m_graphHeader {};
|
|
|
|
|
|
2023-04-02 12:17:12 +03:00
|
|
|
edict_t *m_editor {};
|
2019-08-12 14:16:28 +03:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
BotGraph ();
|
|
|
|
|
~BotGraph () = default;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
int getFacingIndex ();
|
2023-06-24 02:36:51 +03:00
|
|
|
int getFarest (const Vector &origin, const float maxRange = 32.0);
|
|
|
|
|
int getForAnalyzer (const Vector &origin, const float maxRange);
|
|
|
|
|
int getNearest (const Vector &origin, const float range = kInfiniteDistance, int flags = -1);
|
2024-06-29 13:59:52 +03:00
|
|
|
int getNearestNoBuckets (const Vector &origin, const float range = kInfiniteDistance, int flags = -1);
|
2024-01-19 00:03:45 +03:00
|
|
|
int getEditorNearest (const float maxRange = 50.0f);
|
2019-08-12 14:16:28 +03:00
|
|
|
int clearConnections (int index);
|
2021-09-20 13:50:00 +03:00
|
|
|
int getBspSize ();
|
2023-04-11 22:32:28 +03:00
|
|
|
int locateBucket (const Vector &pos);
|
2019-08-12 14:16:28 +03:00
|
|
|
|
|
|
|
|
float calculateTravelTime (float maxSpeed, const Vector &src, const Vector &origin);
|
|
|
|
|
|
|
|
|
|
bool convertOldFormat ();
|
|
|
|
|
bool isConnected (int a, int b);
|
|
|
|
|
bool isConnected (int index);
|
2023-05-02 09:42:43 +03:00
|
|
|
bool isNodeReacheableEx (const Vector &src, const Vector &destination, const float maxHeight);
|
2019-08-12 14:16:28 +03:00
|
|
|
bool isNodeReacheable (const Vector &src, const Vector &destination);
|
2023-05-02 09:42:43 +03:00
|
|
|
bool isNodeReacheableWithJump (const Vector &src, const Vector &destination);
|
2024-12-20 01:04:59 +03:00
|
|
|
bool checkNodes (bool teleportPlayer, bool onlyPaths = false);
|
2019-08-12 14:16:28 +03:00
|
|
|
bool isVisited (int index);
|
2023-05-02 09:42:43 +03:00
|
|
|
bool isAnalyzed () const;
|
2019-08-12 14:16:28 +03:00
|
|
|
|
|
|
|
|
bool saveGraphData ();
|
|
|
|
|
bool loadGraphData ();
|
2020-07-11 20:34:26 +03:00
|
|
|
bool canDownload ();
|
2019-08-12 14:16:28 +03:00
|
|
|
|
|
|
|
|
void saveOldFormat ();
|
2020-09-26 18:41:53 +03:00
|
|
|
void reset ();
|
2019-08-12 14:16:28 +03:00
|
|
|
void frame ();
|
2023-05-02 09:42:43 +03:00
|
|
|
void populateNodes ();
|
2023-06-24 03:23:22 +03:00
|
|
|
void syncInitLightLevels ();
|
2019-08-12 14:16:28 +03:00
|
|
|
void initLightLevels ();
|
2020-01-08 18:29:28 +03:00
|
|
|
void initNarrowPlaces ();
|
2019-08-12 14:16:28 +03:00
|
|
|
void addPath (int addIndex, int pathIndex, float distance);
|
2019-08-18 21:00:00 +03:00
|
|
|
void add (int type, const Vector &pos = nullptr);
|
2019-08-12 14:16:28 +03:00
|
|
|
void erase (int target);
|
|
|
|
|
void toggleFlags (int toggleFlag);
|
|
|
|
|
void setRadius (int index, float radius);
|
|
|
|
|
void pathCreate (char dir);
|
|
|
|
|
void erasePath ();
|
2023-08-08 11:48:37 +03:00
|
|
|
void resetPath (int index);
|
2019-08-12 14:16:28 +03:00
|
|
|
void cachePoint (int index);
|
|
|
|
|
void calculatePathRadius (int index);
|
|
|
|
|
void addBasic ();
|
|
|
|
|
void setSearchIndex (int index);
|
|
|
|
|
void startLearnJump ();
|
|
|
|
|
void setVisited (int index);
|
|
|
|
|
void clearVisited ();
|
|
|
|
|
void initBuckets ();
|
|
|
|
|
void addToBucket (const Vector &pos, int index);
|
|
|
|
|
void eraseFromBucket (const Vector &pos, int index);
|
2019-08-24 12:43:42 +03:00
|
|
|
void setBombOrigin (bool reset = false, const Vector &pos = nullptr);
|
2019-08-12 14:16:28 +03:00
|
|
|
void unassignPath (int from, int to);
|
|
|
|
|
void convertFromPOD (Path &path, const PODPath &pod);
|
|
|
|
|
void convertToPOD (const Path &path, PODPath &pod);
|
|
|
|
|
void convertCampDirection (Path &path);
|
2020-08-23 11:08:27 +03:00
|
|
|
void setAutoPathDistance (const float distance);
|
2020-08-31 14:52:12 +03:00
|
|
|
void showStats ();
|
2022-09-21 14:47:36 +03:00
|
|
|
void showFileInfo ();
|
2023-05-02 09:42:43 +03:00
|
|
|
void emitNotify (int32_t sound);
|
2024-01-30 14:37:14 +03:00
|
|
|
void syncCollectOnline ();
|
|
|
|
|
void collectOnline ();
|
2019-08-12 14:16:28 +03:00
|
|
|
|
2024-06-06 20:38:05 +03:00
|
|
|
IntArray getNearestInRadius (float radius, const Vector &origin, int maxCount = -1);
|
2023-04-11 22:32:28 +03:00
|
|
|
const IntArray &getNodesInBucket (const Vector &pos);
|
2019-08-12 14:16:28 +03:00
|
|
|
|
|
|
|
|
public:
|
2024-05-07 23:11:21 +03:00
|
|
|
int32_t getMaxRouteLength () const {
|
2024-05-15 10:14:18 +03:00
|
|
|
return (length () / 2) + (kMaxNodes / 256);
|
2020-11-23 00:06:18 +03:00
|
|
|
}
|
|
|
|
|
|
2020-10-01 10:43:51 +03:00
|
|
|
StringRef getAuthor () const {
|
2022-09-21 14:47:36 +03:00
|
|
|
return m_graphAuthor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StringRef getModifiedBy () const {
|
|
|
|
|
return m_graphModified;
|
2019-08-12 14:16:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool hasChanged () const {
|
|
|
|
|
return m_hasChanged;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool hasEditFlag (int flag) const {
|
|
|
|
|
return !!(m_editFlags & flag);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setEditFlag (int flag) {
|
|
|
|
|
m_editFlags |= flag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void clearEditFlag (int flag) {
|
|
|
|
|
m_editFlags &= ~flag;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-24 12:43:42 +03:00
|
|
|
const Vector &getBombOrigin () const {
|
|
|
|
|
return m_bombOrigin;
|
2019-08-12 14:16:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// access paths
|
|
|
|
|
Path &operator [] (int index) {
|
|
|
|
|
return m_paths[index];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check nodes range
|
2024-01-19 00:03:45 +03:00
|
|
|
template <typename U> bool exists (U index) const {
|
|
|
|
|
return index >= 0 && index < static_cast <U> (length ());
|
2019-08-12 14:16:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get real nodes num
|
aim: verify camp angles from nav data before using them
aim: tweaked a bit grenade handling, so bots should use them more
aim: reduce time between selecting grenade and throwing it away
aim: removed hacks in look angles code, due to removing yb_whoose_your_daddy cvar
aim: use direct enemy origin from visibility check, and not re-calculate it
aim: update enemy prediction, so it now depends on frame interval for a bot
aim: additional height offset are tweaked, and now used only for difficulty 4
nav: tweaked a bit player avoidance code, and it's not preventing bot from checking terrain
nav: do not check banned nodes, when bucket sizes re too low
nav: cover nodes are now selected depending on total bots on server
nav: let bot enter pause task after long jump
nav: extend velocity by a little for a jump, like it was in first versions of bot
nav: stuck checking is now taken in account lower minimal speed if bot is ducking
fix: navigation reachability timers, so bots will have correct current node index while camping
fix: bots are unable to finish pickup or destroy breakable task, if target is not reachable
fix: cover nodes are now calculated as they should
fix: manual calling bots add_[t/ct] now ignores yb_join_team cvar
bot: tweaked a little difficulty levels, so level 4 is now nightmare level, and 3 is very heard
bot: minor refactoring and moving functions to correct source file
bot: add yb_economics_disrespect_percent, so bots can ignore economics and buy more different guns
bot: add yb_check_darkness that allows to disable darkness checks for bot, thus disallowing usage of flashlight
bot: camp buttons are now lightly depends on bot health
chat: welcome chat message from bots is now sent during first freeze time period
crlib: switch over to stdint.h and remove crlib-own types
crlib: fixed alignment in sse code
2023-04-07 14:46:49 +03:00
|
|
|
int32_t length () const {
|
|
|
|
|
return m_paths.length <int32_t> ();
|
2019-08-12 14:16:28 +03:00
|
|
|
}
|
|
|
|
|
|
2023-05-08 00:44:14 +03:00
|
|
|
// get the random node on map
|
|
|
|
|
int32_t random () const {
|
2024-04-25 15:03:39 +03:00
|
|
|
return rg (0, length () - 1);
|
2023-05-08 00:44:14 +03:00
|
|
|
}
|
|
|
|
|
|
2019-08-12 14:16:28 +03:00
|
|
|
// check if has editor
|
|
|
|
|
bool hasEditor () const {
|
|
|
|
|
return !!m_editor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// set's the node editor
|
|
|
|
|
void setEditor (edict_t *ent) {
|
|
|
|
|
m_editor = ent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get the current node editor
|
|
|
|
|
edict_t *getEditor () {
|
|
|
|
|
return m_editor;
|
|
|
|
|
}
|
2023-04-11 22:32:28 +03:00
|
|
|
|
2023-05-12 22:12:22 +03:00
|
|
|
// silence all graph messages or not
|
2023-05-02 09:42:43 +03:00
|
|
|
void setMessageSilence (bool enable) {
|
|
|
|
|
m_silenceMessages = enable;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// set exten header from binary storage
|
|
|
|
|
void setExtenHeader (ExtenHeader *hdr) {
|
|
|
|
|
memcpy (&m_extenHeader, hdr, sizeof (ExtenHeader));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// set graph header from binary storage
|
|
|
|
|
void setGraphHeader (StorageHeader *hdr) {
|
|
|
|
|
memcpy (&m_graphHeader, hdr, sizeof (StorageHeader));
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-17 22:43:35 +03:00
|
|
|
// gets the node numbers
|
|
|
|
|
const IntArray &getNodeNumbers () {
|
|
|
|
|
return m_nodeNumbers;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-02 09:42:43 +03:00
|
|
|
public:
|
2023-05-12 22:12:22 +03:00
|
|
|
// graph helper for sending message to correct channel
|
2023-05-02 09:42:43 +03:00
|
|
|
template <typename ...Args> void msg (const char *fmt, Args &&...args);
|
|
|
|
|
|
2023-04-11 22:32:28 +03:00
|
|
|
public:
|
|
|
|
|
Path *begin () {
|
|
|
|
|
return m_paths.begin ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Path *begin () const {
|
|
|
|
|
return m_paths.begin ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Path *end () {
|
|
|
|
|
return m_paths.end ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Path *end () const {
|
|
|
|
|
return m_paths.end ();
|
|
|
|
|
}
|
2019-08-12 14:16:28 +03:00
|
|
|
};
|
|
|
|
|
|
2020-06-12 18:52:38 +03:00
|
|
|
#include <manager.h>
|
2023-05-02 09:42:43 +03:00
|
|
|
#include <practice.h>
|
2020-06-12 18:52:38 +03:00
|
|
|
|
2023-05-12 22:12:22 +03:00
|
|
|
// expose global
|
2020-02-08 00:03:52 +03:00
|
|
|
CR_EXPOSE_GLOBAL_SINGLETON (BotGraph, graph);
|