Pioneer
Loading...
Searching...
No Matches
GalaxyEditAPI.h
Go to the documentation of this file.
1// Copyright © 2008-2024 Pioneer Developers. See AUTHORS.txt for details
2// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3
4#pragma once
5
6#include "galaxy/StarSystem.h"
7#include "galaxy/SystemBody.h"
8
9class LuaNameGen;
11
12namespace Editor {
13 class UndoSystem;
14
20 };
21
23 bool randomLawlessness = true;
24 bool randomFaction = true;
25
26 std::string faction;
27 std::string comment;
28 };
29}
30
32public:
33 static void RemoveFromCache(StarSystem *system);
34
35 static SystemBody *NewBody(StarSystem *system);
36 static SystemBody *NewBodyAround(StarSystem *system, Random &rng, SystemBody *primary, size_t idx);
37
38 static void AddBody(StarSystem *system, SystemBody *body, size_t idx = -1);
39 static void RemoveBody(StarSystem *system, SystemBody *body);
40
41 // Set body index from hierarchy order
42 static void ReorderBodyIndex(StarSystem *system);
43 // Set body hierarchy from index order
44 static void ReorderBodyHierarchy(StarSystem *system);
45
46 // Sort the bodies in the system based on semi-major axis
47 static void SortBodyHierarchy(StarSystem *system, Editor::UndoSystem *undo);
48
49 static void EditName(StarSystem *system, Random &rng, Editor::UndoSystem *undo);
50 static void EditProperties(StarSystem *system, Editor::CustomSystemInfo &custom, FactionsDatabase *factions, Editor::UndoSystem *undo);
51};
52
54public:
55 static void GenerateDefaultName(SystemBody *body);
56 static void GenerateCustomName(SystemBody *body, Random &rng);
57
58 static void AddChild(SystemBody *parent, SystemBody *child, size_t idx = -1);
59 static SystemBody *RemoveChild(SystemBody *parent, size_t idx = -1);
60 static size_t GetIndexInParent(SystemBody *body);
61
62 static void EditOrbitalParameters(SystemBody *body, Editor::UndoSystem *undo);
65 static void EditBodyName(SystemBody *body, Random &rng, LuaNameGen *nameGen, Editor::UndoSystem *undo);
66 static void EditProperties(SystemBody *body, Random &rng, Editor::UndoSystem *undo);
67
68 static void GenerateDerivedStats(SystemBody *body, Random &rng, Editor::UndoSystem *undo);
69};
Definition: UndoSystem.h:112
Definition: Factions.h:87
Definition: LuaNameGen.h:14
Definition: Random.h:29
Definition: GalaxyEditAPI.h:31
static void RemoveFromCache(StarSystem *system)
Definition: GalaxyEditAPI.cpp:60
static void EditName(StarSystem *system, Random &rng, Editor::UndoSystem *undo)
Definition: GalaxyEditAPI.cpp:222
static void AddBody(StarSystem *system, SystemBody *body, size_t idx=-1)
Definition: GalaxyEditAPI.cpp:114
static void ReorderBodyIndex(StarSystem *system)
Definition: GalaxyEditAPI.cpp:130
static void ReorderBodyHierarchy(StarSystem *system)
Definition: GalaxyEditAPI.cpp:156
static SystemBody * NewBodyAround(StarSystem *system, Random &rng, SystemBody *primary, size_t idx)
Definition: GalaxyEditAPI.cpp:73
static void EditProperties(StarSystem *system, Editor::CustomSystemInfo &custom, FactionsDatabase *factions, Editor::UndoSystem *undo)
Definition: GalaxyEditAPI.cpp:290
static void SortBodyHierarchy(StarSystem *system, Editor::UndoSystem *undo)
Definition: GalaxyEditAPI.cpp:183
static void RemoveBody(StarSystem *system, SystemBody *body)
Definition: GalaxyEditAPI.cpp:123
Definition: StarSystem.h:28
SystemBody * NewBody()
Definition: StarSystem.h:110
Definition: GalaxyEditAPI.h:53
static void GenerateDefaultName(SystemBody *body)
Definition: GalaxyEditAPI.cpp:385
static size_t GetIndexInParent(SystemBody *body)
Definition: GalaxyEditAPI.cpp:452
static void EditProperties(SystemBody *body, Random &rng, Editor::UndoSystem *undo)
Definition: GalaxyEditAPI.cpp:622
static void EditBodyName(SystemBody *body, Random &rng, LuaNameGen *nameGen, Editor::UndoSystem *undo)
Definition: GalaxyEditAPI.cpp:600
static void EditOrbitalParameters(SystemBody *body, Editor::UndoSystem *undo)
Definition: GalaxyEditAPI.cpp:465
static void EditStarportProperties(SystemBody *body, Editor::UndoSystem *undo)
Definition: GalaxyEditAPI.cpp:567
static void EditEconomicProperties(SystemBody *body, Editor::UndoSystem *undo)
Definition: GalaxyEditAPI.cpp:550
static void AddChild(SystemBody *parent, SystemBody *child, size_t idx=-1)
Definition: GalaxyEditAPI.cpp:428
static void GenerateDerivedStats(SystemBody *body, Random &rng, Editor::UndoSystem *undo)
Definition: GalaxyEditAPI.cpp:790
static SystemBody * RemoveChild(SystemBody *parent, size_t idx=-1)
Definition: GalaxyEditAPI.cpp:439
static void GenerateCustomName(SystemBody *body, Random &rng)
Definition: SystemBody.h:137
Definition: ActionBinder.h:14
Definition: GalaxyEditAPI.h:15
bool randomLawlessness
Definition: GalaxyEditAPI.h:23
std::string faction
Definition: GalaxyEditAPI.h:26
ExplorationState explored
Definition: GalaxyEditAPI.h:22
ExplorationState
Definition: GalaxyEditAPI.h:16
@ EXPLORE_ExploredAtStart
Definition: GalaxyEditAPI.h:18
@ EXPLORE_Unexplored
Definition: GalaxyEditAPI.h:19
@ EXPLORE_Random
Definition: GalaxyEditAPI.h:17
std::string comment
Definition: GalaxyEditAPI.h:27
bool randomFaction
Definition: GalaxyEditAPI.h:24