Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#4095 closed enhancement (fixed)

[PATCH] Rename CNetTurnManager to CTurnManager

Reported by: elexis Owned by: echotangoecho
Priority: Nice to Have Milestone: Alpha 22
Component: Core engine Keywords: patch
Cc: Patch:

Description

The class CNetTurnManager is inherited for classes that simulate without being networked, for example CNetReplayTurnManager and CNetLocalTurnManager.

/**
 * Implementation of CNetTurnManager for offline games.
 */
class CNetLocalTurnManager : public CNetTurnManager

The name of the class suggests that networking code is involved, while it isn't necessarily.

The comment at the top of the file will have to be updated a bit, perhaps moved (but not degraded).

Attachments (10)

rename_CNetTurnManager.patch (9.0 KB ) - added by Sandarac 8 years ago.
Not exactly sure how to reword the comment.
rename_CNetTurnManager_v2.patch (13.2 KB ) - added by Sandarac 8 years ago.
Rename all three classes.
rename.patch (58.3 KB ) - added by echotangoecho 8 years ago.
Split the turnmanagers across files as suggested by elexis, remove the virtual functions OnSyncError and DisplayOOSError from the CTurnManager.
movehexify.patch (4.4 KB ) - added by echotangoecho 8 years ago.
Moves the function Hexify which occurs in multiple source files to ps/Util.h and removes the useless extern keyword from function declarations in that file.
movehexify2.patch (4.4 KB ) - added by echotangoecho 8 years ago.
Change the previous patch to make the Hexify function use a range-based for loop.
movehexify3.patch (4.4 KB ) - added by echotangoecho 8 years ago.
change for (char c : s) to for (const char& c : s).
split.patch (72.5 KB ) - added by echotangoecho 7 years ago.
split.2.patch (69.9 KB ) - added by echotangoecho 7 years ago.
rebased patch
split.3.patch (70.6 KB ) - added by echotangoecho 7 years ago.
split.4.patch (72.2 KB ) - added by echotangoecho 7 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 by elexis, 8 years ago

Component: UI & SimulationCore engine

by Sandarac, 8 years ago

Not exactly sure how to reword the comment.

comment:2 by Sandarac, 8 years ago

Keywords: rfc patch added
Milestone: BacklogAlpha 21
Summary: Rename CNetTurnManager to CTurnManager[PATCH] Rename CNetTurnManager to CTurnManager

by Sandarac, 8 years ago

Rename all three classes.

comment:3 by elexis, 8 years ago

The filepath source/network/CNetTurnManager.* seems questionable too. Should the classes be split across several files? Should the networked turnmanager be moved to NetClient.cpp and NetServer.cpp or moved to individual files inside network/, while moving the offline and parent class to source/ps, source/simulation2? (Or would it better to keep it all in one file? (likely not))

comment:4 by echotangoecho, 8 years ago

Owner: set to echotangoecho
Status: newassigned

by echotangoecho, 8 years ago

Attachment: rename.patch added

Split the turnmanagers across files as suggested by elexis, remove the virtual functions OnSyncError and DisplayOOSError from the CTurnManager.

by echotangoecho, 8 years ago

Attachment: movehexify.patch added

Moves the function Hexify which occurs in multiple source files to ps/Util.h and removes the useless extern keyword from function declarations in that file.

by echotangoecho, 8 years ago

Attachment: movehexify2.patch added

Change the previous patch to make the Hexify function use a range-based for loop.

by echotangoecho, 8 years ago

Attachment: movehexify3.patch added

change for (char c : s) to for (const char& c : s).

comment:5 by Itms, 8 years ago

In 18591:

Remove duplication of the Hexify function.
Remove the useless extern keyword from function declarations in ps/Util.h.

Patch by echotangoecho, refs #4095

comment:6 by elexis, 8 years ago

Keywords: simple removed

comment:7 by elexis, 8 years ago

Milestone: Alpha 21Alpha 22

Too few time remaining for this release.

by echotangoecho, 7 years ago

Attachment: split.patch added

comment:8 by elexis, 7 years ago

Milestone: Alpha 22Work In Progress

Moving to the new WIP milestone.

by echotangoecho, 7 years ago

Attachment: split.2.patch added

rebased patch

by echotangoecho, 7 years ago

Attachment: split.3.patch added

by echotangoecho, 7 years ago

Attachment: split.4.patch added

comment:9 by elexis, 7 years ago

Resolution: fixed
Status: assignedclosed

In 19165:

Split TurnManager classes into individual files per class. Patch by echotangoecho, fixes #4095.
Remove the "Net" prefix from the non-networked classes.
Use variadic macros and mark the client turnmanager as NONCOPYABLE.

Differential Revision: D16
Reviewed By: leper

comment:10 by elexis, 7 years ago

Keywords: rfc removed
Milestone: Work In ProgressAlpha 22

Thanks for the branch, going through the revisions and updating the CPPSupport wiki page!

Note: See TracTickets for help on using tickets.