Commit Graph

114 Commits (master)

Author SHA1 Message Date
Gliese852 20551ae2ea Improve Tradeships.lua
- Preparations:

Add method Ship:GetCargo
Add method Ship:GetDurationForDistance
Add method Ship:Create
Add method ui.treeNode & ui.treePop
Add method LuaObject::CreateInLua
Add functions for convenient selection of a random array element
Add some numerical utilites
Add a tool to easily draw a table from an array
Fix ui.Format.Number
Turn off the output when the ship changes frames
Reduce the detection range of hyperspace clouds
Remove the call LuaEvent::Emit immediately after exiting hyperspace
Split Tradeships.lua into 5 modules

- Tradeships

For current system, calculate all possible routes of tradeships,
durations, flows; arrange ships in space in such equilibrium state,
as if the have been flying about their business for a long time.

Calculate the average spawn interval for new ships, and parking
intervals, so that the stations are not overcrowded or empty.

Сreate a tab in the debug window with full information on
routes, ships, stations, remote systems.
2021-05-02 17:25:57 -04:00
Karl F 9e44b09314 Happy new year!
HAPPY MERRY 2021!
2021-01-03 19:40:16 +01:00
Webster Sheets 37c96041e1
Refactor Body inheritance tree to remove Object and CityOnPlanet (#4995)
* Remove CityOnPlanet from Object hierarchy

* Remove Object from the inheritance hierarchy

* Rename Object -> ObjectType
2020-11-11 19:33:04 -05:00
Webster Sheets b71787c942 Major changes to WorldView screen functions
- Body::GetTargetIndicatorPosition now returns local-space coordinates
- CameraContext has a getter for parent frame, renamed GetCamFrame to GetTempFrame, added GetCameraOrient/Position
- Implemented matrix4x4 utilities to construct from orient+pos, fast inverse transform for position vectors
- Fixed bug where mouse would be locked if held while docking
- Preliminary work on ShipViewController, made WorldView::shipView an unique_ptr (why didn't I do it that way in the first place?)
- Cleaned up some cruft from WorldView and moved to appropriate locations
- Completely changed the way WorldSpaceToScreenSpace etc. works, now no longer requires camera frame
- Added WorldView::RelSpaceToScreenSpace, meant for pigui to use for displaying e.g. body:GetPositionRelTo(player)
- WorldSpaceToScreenSpace now operates on frame-relative coordinates, use RelSpaceToScreenSpace for player-relative coordinates
2020-08-02 17:35:09 -04:00
Andrew Copland e331bce0d6 Get std::string explicitly from json 2020-03-23 21:54:30 +00:00
Webster Sheets ec410f31d8 Update includes to point to new lua/ directory 2020-01-20 18:13:45 -05:00
Karl F 436db08636 Happy new decade!
May you live long and prosper!
2020-01-01 10:47:46 +01:00
Webster Sheets 2e8376523e Promote FrameId to wrapper and fix crash, remove unused test (#4745)
* Make FrameId a wrapper over an int, fix crashes

- Cleanup some of the tests, use <cstddef>.
- Fixed a crash in Frame::DeleteCameraFrame()
- Made CameraContext::GetCamFrame() return the invalid frame index when there
  is no camera frame
- Fixed a typo related to autosave
2019-11-26 09:26:59 +01:00
mike-f1 4f1eaa41d3 Update all files to store and use FrameId instead of raw pointers 2019-11-16 17:54:14 +01:00
mike-f1 3a0aa4301b Move frame indexing and save/load function from Space to Frame 2019-11-16 17:54:14 +01:00
mike-f1 e6403fc1ad Decouple includes; Remove some unused variable; Fix an equation in Space.cpp 2019-10-20 11:19:45 +02:00
mike-f1 3c097a555b Clang formatting 2019-02-04 21:27:17 +01:00
mike-f1 ae1e52d1ab Remove LoadFromJson in Body, instead use dedicated ctor; modify related children classes; remove some include here and there 2019-02-03 20:46:19 +01:00
mike-f1 bbb6416528 Delete default ctor in Ship and Player; avoid variable definition with std::tie in Ship; Move LuaObject push outside of ctor (...read Body) 2019-02-03 20:45:11 +01:00
mike-f1 e8b50fe32f Delete default ctor in Missile and use a ctor for loading 2019-02-03 20:44:55 +01:00
mike-f1 13550d82ba Delete default ctor in HyperspaceCloud and use a ctor for loading 2019-02-03 20:44:50 +01:00
mike-f1 7b38584dcc Delete default ctor and use ctor for load in CargoBody 2019-02-03 20:44:28 +01:00
mike-f1 42c37fab84 Delete default ctor for SpaceStation and Projectile, use a ctor for load 2019-02-03 20:43:52 +01:00
mike-f1 0ffe9fc3b2 Close default ctor on Star and Planet and load directly 2019-02-03 20:32:21 +01:00
mike-f1 bcb31c6e28 Clean includes in Body 2019-01-22 20:08:25 +01:00
Webster Sheets 5cdaefad6a Run clang-format over the entire code base.
Fix hidden header-inclusion-order dependency errors.
Update .clang-format for v7.0.1.
2019-01-05 17:09:05 -05:00
Karl F d2ab921b62 Happy New Year!
Awesome sauce (for next year):
find . -type f -exec sed -i 's/2008-2018 Pioneer Developers'/'2008-2019 Pioneer Developers/g' {} \;

closes #4507
2019-01-03 15:28:42 +01:00
Andrew Copland 4be499f98f Fix the unused variable warnings caused by (Json::type_error &e) 2018-10-17 21:38:23 +01:00
Webster Sheets 3a3a13edec Update pioneer to use the new save system. 2018-10-11 11:45:57 -04:00
John Bartholomew 67dcbcecf6 Move JsonUtils.h/cpp from contrib/json/ to src/
These files aren't part of the jsoncpp library and are custom for Pioneer.
They also directly include various other Pioneer source files.
2018-08-26 09:55:14 +01:00
Karl F 7225e9c723 Happy New Year!
Ten years in the making now, but how can we improve upon perfection
for ten more years?
2018-01-01 21:22:12 +01:00
John Bartholomew 7c3a13a0c0 Remove almost all includes of Serializer.h, include GameSaveError.h where necessary. 2017-12-26 13:02:26 +00:00
Andrew Copland 8cb1555f67 Eliminate the evil trailing whitespace 2017-03-05 13:15:55 +00:00
Andrew Copland 74d50958fe MERRY HAPPY 2017 2017-01-04 15:11:15 +00:00
Andrew Copland fea5ac26b2 MERRY HAPPY 2016 2016-01-29 11:31:54 +00:00
Andrew Copland d96b4f215a These values don't change so const them. 2015-10-11 18:45:03 +01:00
nick-the-ninja 65114371b9 Minor correction to JSON type. 2015-03-04 23:01:16 +00:00
nick-the-ninja 724eb89d47 Removing old serialisation code in body classes, Game and Space. Added JSON serialisation code to classes Player and Space. Pioneer would not have saved and loaded correctly without it. 2015-02-17 22:54:23 +00:00
nick-the-ninja 96ae402365 Added JSON serialisation code for Body (base class for all bodies). 2015-02-16 23:13:46 +00:00
Robert Norris 9f95339a9d MERRY HAPPY 2014-12-31 23:05:37 +11:00
Simon Chopin 78ee5bff28 Save the properties and bump the save version 2014-06-26 15:56:01 +02:00
lwho b88d4c9e7c Switch access to Frame::m_children to IterationProxy interface. 2014-02-22 17:54:57 +01:00
Robert Norris 714c296fc1 send all output through the Output function instead of *printf 2014-01-28 20:40:09 +11:00
Robert Norris 6dc4283eb6 happy new year 2014-01-02 14:43:38 +11:00
Robert Norris 85e2dc10a6 replace NULL with plain old 0 as the C++ gods intended 2013-05-09 07:35:48 +10:00
John Bartholomew 96e82ee2a0 Avoid virtual setters during Load/initialisation. Fixes #2221.
Load/Init should only be setting up state, whereas virtual setters are
often overriden in derived classes to trigger things on particular state
changes (e.g., put a message in the ship console when the ship alert state
changes). Load/Init is not a state change, because there's no (valid)
previous state.
2013-04-20 19:15:23 +01:00
Robert Norris a964675fe8 property for Body.label 2013-04-16 08:52:34 +10:00
Robert Norris ad11c9c8f8 make Body tree inherit PropertiedObject to get its properties
Conflicts:
	src/LuaBody.h
	src/LuaCargoBody.h
	src/LuaEquipDef.h
	src/LuaMissile.h
	src/LuaObject.cpp
	src/LuaObject.h
	src/LuaPlanet.h
	src/LuaSpaceStation.h
2013-04-16 08:52:33 +10:00
Robert Norris 012ac90e38 make property map a field, and have one on each body. hackishly teach the lua dispatcher about it 2013-04-16 08:52:33 +10:00
Andrew Copland 187d724c02 Correctly initialise the Body class. 2013-02-09 18:47:01 +00:00
Robert Norris 91b8586653 happy new year 2013-01-01 12:36:52 +11:00
John Bartholomew 290b07765c use a std::vector for Frame children and iterate with normal iterators 2012-12-29 02:31:52 +00:00
John Bartholomew 5b4e0bee8e delete some dead (commented out) code 2012-12-29 01:17:51 +00:00
John Jordan 18f14a4a39 Clean up matrix3x3 2012-12-16 23:11:34 +00:00
John Jordan 2d41471c98 Fix terminal docking rotation and debug output 2012-12-05 03:27:23 +00:00