Page MenuHomeWildfire Games

Create a C++ interface for cmpAttack
ClosedPublic

Authored by Stan on Dec 11 2019, 10:38 PM.

Details

Reviewers
Silier
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP23592: Add a C++ interface for CCmpAttack.
Trac Tickets
#5129
Summary

See #5129

Test Plan

Note the code now works as expected.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/simulation2/components/ICmpAttack.h
|  23| class·ICmpAttack·:·public·IComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpAttack:' is invalid C code. Use --std or --language to configure the language.

source/tools/atlas/GameInterface/ActorViewer.cpp
| 211| »   /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Unmatched '}'. Configuration: 'MESSAGESSETUP_NOTFIRST'.
Executing section JS...

binaries/data/mods/public/simulation/components/Attack.js
| 430| »   return·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Function expected no return value.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1882/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/simulation2/components/ICmpAttack.h
|  23| class·ICmpAttack·:·public·IComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpAttack:' is invalid C code. Use --std or --language to configure the language.

source/tools/atlas/GameInterface/ActorViewer.cpp
| 211| »   /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Unmatched '}'. Configuration: 'MESSAGESSETUP_NOTFIRST'.
Executing section JS...

binaries/data/mods/public/simulation/components/Attack.js
| 430| »   return·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Function expected no return value.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1883/display/redirect

Silier added a subscriber: Silier.Apr 15 2020, 1:14 PM
Silier added inline comments.
binaries/data/mods/public/simulation/components/Attack.js
408 ↗(On Diff #11524)

if repeattime does not exist or is 0, modifications would apply before this patch

source/tools/atlas/GameInterface/ActorViewer.cpp
423 ↗(On Diff #11524)

so this was bugged whole time ?

Stan updated this revision to Diff 11677.Apr 15 2020, 1:32 PM
Stan marked an inline comment as done.

Fix inlines

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/simulation2/components/ICmpAttack.h
|  23| class·ICmpAttack·:·public·IComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpAttack:' is invalid C code. Use --std or --language to configure the language.

source/tools/atlas/GameInterface/ActorViewer.cpp
| 211| »   /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Unmatched '}'. Configuration: 'MESSAGESSETUP_NOTFIRST'.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2000/display/redirect

Stan updated this revision to Diff 11678.Apr 15 2020, 3:31 PM

int
int → float

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2001/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/587/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1474/display/redirect

Stan updated this revision to Diff 11679.Apr 15 2020, 3:37 PM

fix return type

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/simulation2/components/ICmpAttack.h
|  23| class·ICmpAttack·:·public·IComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpAttack:' is invalid C code. Use --std or --language to configure the language.

source/tools/atlas/GameInterface/ActorViewer.cpp
| 211| »   /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Unmatched '}'. Configuration: 'MESSAGESSETUP_NOTFIRST'.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2002/display/redirect

Stan updated this revision to Diff 11685.Apr 17 2020, 3:34 PM

Add const helper

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/593/display/redirect

Stan updated this revision to Diff 11686.Apr 17 2020, 3:41 PM

fix typo

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1480/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2007/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/594/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1481/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2008/display/redirect

Stan updated this revision to Diff 11687.Apr 17 2020, 3:52 PM

Rename function to make it more explicit

Stan updated this revision to Diff 11688.Apr 17 2020, 4:14 PM

Fix whitespace

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/tools/atlas/GameInterface/ActorViewer.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/tools/atlas/GameInterface/ActorViewer.h
|  29| class·ActorViewer
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classActorViewer{' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/ICmpAttack.h
|  23| class·ICmpAttack·:·public·IComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpAttack:' is invalid C code. Use --std or --language to configure the language.

source/tools/atlas/GameInterface/ActorViewer.cpp
| 211| »   /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Unmatched '}'. Configuration: 'MESSAGESSETUP_NOTFIRST'.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2009/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/tools/atlas/GameInterface/ActorViewer.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/tools/atlas/GameInterface/ActorViewer.h
|  29| class·ActorViewer
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classActorViewer{' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/ICmpAttack.h
|  23| class·ICmpAttack·:·public·IComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpAttack:' is invalid C code. Use --std or --language to configure the language.

source/tools/atlas/GameInterface/ActorViewer.cpp
| 211| »   /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Unmatched '}'. Configuration: 'MESSAGESSETUP_NOTFIRST'.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2010/display/redirect

Silier requested changes to this revision.Apr 19 2020, 11:04 AM
Silier added inline comments.
source/tools/atlas/GameInterface/ActorViewer.cpp
388 ↗(On Diff #11688)

needs to be 0 when no moving animation is selected else unit will slide when Move button is activated in atlas

source/tools/atlas/GameInterface/ActorViewer.h
1 ↗(On Diff #11688)

^

This revision now requires changes to proceed.Apr 19 2020, 11:04 AM
Stan updated this revision to Diff 11690.Apr 19 2020, 11:18 AM
Stan marked 2 inline comments as done.

Remove useless local variable
Only set speed if using moving animations
Bump copyright

Stan updated this revision to Diff 11691.Apr 19 2020, 11:21 AM
Stan marked an inline comment as done.

fix build

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/598/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1485/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2012/display/redirect

Silier added inline comments.Apr 19 2020, 11:42 AM
source/tools/atlas/GameInterface/ActorViewer.cpp
413 ↗(On Diff #11691)

^ this is wrong

419 ↗(On Diff #11691)

also this, because animation like build, promotion etc will get movement or with fix to L413 movement

Silier added inline comments.Apr 19 2020, 11:44 AM
source/tools/atlas/GameInterface/ActorViewer.cpp
419 ↗(On Diff #11691)
  • with fix to L413 no animation speed
Stan updated this revision to Diff 11692.Apr 19 2020, 11:50 AM
  • Fix brain

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/tools/atlas/GameInterface/ActorViewer.h
|  29| class·ActorViewer
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classActorViewer{' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/ICmpAttack.h
|  23| class·ICmpAttack·:·public·IComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpAttack:' is invalid C code. Use --std or --language to configure the language.

source/tools/atlas/GameInterface/ActorViewer.cpp
| 211| »   /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Unmatched '}'. Configuration: 'MESSAGESSETUP_NOTFIRST'.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2013/display/redirect

Stan marked 3 inline comments as done.Apr 19 2020, 12:02 PM
Stan added inline comments.
source/tools/atlas/GameInterface/ActorViewer.cpp
423 ↗(On Diff #11524)

Yep.

Silier accepted this revision.Apr 19 2020, 12:14 PM
This revision is now accepted and ready to land.Apr 19 2020, 12:14 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/tools/atlas/GameInterface/ActorViewer.h
|  29| class·ActorViewer
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classActorViewer{' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/ICmpAttack.h
|  23| class·ICmpAttack·:·public·IComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpAttack:' is invalid C code. Use --std or --language to configure the language.

source/tools/atlas/GameInterface/ActorViewer.cpp
| 211| »   /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Unmatched '}'. Configuration: 'MESSAGESSETUP_NOTFIRST'.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2014/display/redirect

elexis added a subscriber: elexis.Apr 19 2020, 1:02 PM
elexis added inline comments.
source/simulation2/components/ICmpAttack.cpp
34 ↗(On Diff #11692)

(const ref? might need some overload)

source/tools/atlas/GameInterface/ActorViewer.cpp
395 ↗(On Diff #11692)

(excess space)

412 ↗(On Diff #11692)

(good!)

415 ↗(On Diff #11692)

(would be good to remove the hardcoding without substring construction, but can be done elsewhere)

487 ↗(On Diff #11692)

const ref? (perhaps one can avoid std::string construction and pass the char*, but probably not so important here)

423 ↗(On Diff #11524)

What does bugged mean? Is it an unused variable and the variable is still unused after this patch?

Stan added a comment.Apr 19 2020, 1:05 PM

Thanks for looking at the patch @elexis!

Silier added inline comments.Apr 19 2020, 1:23 PM
source/tools/atlas/GameInterface/ActorViewer.cpp
423 ↗(On Diff #11524)

blame rP21359 for usage removal and not tiding up
I did not read code yet when i asked that question

Stan marked 2 inline comments as done.Apr 19 2020, 1:24 PM

I will look into the const ref thingy

source/tools/atlas/GameInterface/ActorViewer.cpp
415 ↗(On Diff #11692)

Should be done if/when attack types are made generic.

423 ↗(On Diff #11524)

Bugged mean it selected the attack sound always and was not updated when more attack types were added.

Stan marked 6 inline comments as done.Apr 19 2020, 2:29 PM
Stan updated this revision to Diff 11695.Apr 19 2020, 2:29 PM

Make param and method const

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/tools/atlas/GameInterface/ActorViewer.h
|  29| class·ActorViewer
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classActorViewer{' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/ICmpAttack.h
|  23| class·ICmpAttack·:·public·IComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpAttack:' is invalid C code. Use --std or --language to configure the language.

source/tools/atlas/GameInterface/ActorViewer.cpp
| 211| »   /**
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Unmatched '}'. Configuration: 'MESSAGESSETUP_NOTFIRST'.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2017/display/redirect

Stan updated this revision to Diff 11698.Apr 19 2020, 4:15 PM

Fix a warning when unit has no prepare time (the parenthesis were necessary)

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2019/display/redirect

This revision was landed with ongoing or failed builds.Apr 21 2020, 11:44 PM
This revision was automatically updated to reflect the committed changes.
Owners added subscribers: Restricted Owners Package, Restricted Owners Package.Apr 21 2020, 11:44 PM