Comments (2)
MissionHandling.fleetMakeMove(final Game game, final int nx, final int ny,
final PlayerInfo info, final Fleet fleet)
``` is used only when fleet are moving with FTL routes.
MissionHandling.fleetMakeMove(final Game game, final PathPoint point,
final PlayerInfo info, final Fleet fleet)
``` is used when fleet is moving with standard moves where PathPoints were calculated with A* search. Both of these method then call game.fleetMakeMove()
which does the actual fleet moving. Reason why this is in game is that there can be game state change during fleet move for example attack or diplomatic trade and only place where to make game state changes is Game class.
They have different logic since they check a bit different things while moving in FTL and while moving with regular moves. For example FTL movement should not start combat, only when moved with same sector with regular move. Javadocs are horrible, since they are identical. I also think that this part in pathpoint fleetMakeMove is dead code.
else {
Message msg = new Message(MessageType.FLEET,
"Fleet encounter another fleet while moving in FTL!",
Icons.getIconByName(Icons.ICON_HULL_TECH));
msg.setCoordinate(fleet.getCoordinate());
msg.setMatchByString(fleet.getName());
info.getMsgList().addNewMessage(msg);
}
from open-realms-of-stars.
Ah, I see, so it is a primarily naming and copied javadoc issue. 👍
One method is technically fleetMoveFTL()
, while the other is fleetMoveRegular()
.
I will rename them, try to extract repeated code, fix Javadoc, remove the presumably dead code and open a PR. Or two, since I did some other smaller refactors in MissionHandling.java
already.
Also, as an experiment, I tried to blindly refactor the methods, leaving only the PathPoint
code version, added like 2 null checks and mixed in the A* search code... All the tests passed and I have not observed any weird behavior in-game. 😄
Maybe the AI now starts combats in FTL, but as a player, I haven't noticed that 😄
from open-realms-of-stars.
Related Issues (20)
- SpaceRace enum dehardcoding HOT 5
- Space Race Editor HOT 2
- New space trait: Plantlife form
- Redesign realm setup view HOT 1
- Refactor Government into class and read data from JSON HOT 1
- Zero gravity beings value planet wrongly HOT 1
- Possibility to ask third party planet locations
- Government Editor
- Check and improve tutorial
- If one the alliance party makes peace with third party peace should both alliance parties
- Flathub package HOT 1
- Doomed starting scenarios should be visible in background story.
- Ready made space race for plant life
- BUG: Realm color does not change in realm setup view in dropdown menu
- High contrast Grid
- Technology beyond level 10
- Allow human player to declare to be winner and let AI play game till end
- Improve planet handling and building selection AI
- Jammers are pretty much useless.
- Planet's suitability is still confusing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-realms-of-stars.