-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructure the processor handling to use a variant object #149
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ocessors Updated ExecuteCost, ExecuteOperation, ExecuteTarget, PhaseEvent, PointEvent, QuickEffect, IdleCommand and partially BattleCommand
ChangePos, SendTo, SpSummonStep, MonsterSet, FlipSummon, Equip, TrapMonsterAdjust, SelfDestroy, ControlAdjust, SwapControl, GetControl, RemoveOverlay and PayLPCost
…and ocgapi Also split the SelfDestroy processor into appropriate subprocesses to keep it clear
So that it's consistent with the c api
Now all the processes use a common structure, except 4 remaining special cases
edo9300
force-pushed
the
processor-variant
branch
from
September 24, 2023 19:31
f954c6e
to
3f204d4
Compare
…ptions disabled for mac os Attempt to work around std::visit's availability only on mac os 10.14+ if built with exceptions
edo9300
force-pushed
the
processor-variant
branch
from
December 9, 2023 11:07
cc02ab6
to
b4569e1
Compare
it wasn't properly handling cancelations
edo9300
force-pushed
the
processor-variant
branch
from
December 24, 2023 15:21
a717040
to
c005c9d
Compare
Actually properly use an optional to handle the only instance of processor_unit used standalone (processor::reserved)
Helps reducing symbol names to ease debugging
edo9300
force-pushed
the
processor-variant
branch
from
December 27, 2023 22:05
2535842
to
cd46537
Compare
edo9300
force-pushed
the
processor-variant
branch
from
January 3, 2024 00:34
969ab33
to
c929b12
Compare
edo9300
force-pushed
the
processor-variant
branch
2 times, most recently
from
January 3, 2024 13:31
709962e
to
5562f0f
Compare
It was only used in the handling of Processors::BattleCommand, properly put the values it was used for in the processor struct
edo9300
force-pushed
the
processor-variant
branch
2 times, most recently
from
January 5, 2024 11:34
0aa14b4
to
665a658
Compare
edo9300
force-pushed
the
master
branch
3 times, most recently
from
January 5, 2024 12:15
45e4132
to
7982ca1
Compare
edo9300
force-pushed
the
processor-variant
branch
2 times, most recently
from
January 5, 2024 14:54
92ab087
to
70b8f13
Compare
This base class, uncopyable holds both the current processor step value and sets the tag to check if the processor needs an answer, cleanung up the implementation of Processors::NeedsAnswer
Rather than having half of them taking it as unsigned, and the other as signed int16
edo9300
force-pushed
the
processor-variant
branch
from
January 7, 2024 11:38
1ad987c
to
d68f1c5
Compare
Bite the extra memory size for each processor, but avoid allocating containers seaparately from the single processors
Enabled by default only when doing debug builds, under visual studio, the processor_unit is then declared as variant of variants, with a maximum of 30 elements each, so that visual studio can display it in the debugger
edo9300
force-pushed
the
processor-variant
branch
from
January 8, 2024 19:30
4f1e348
to
bbcc90d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rewrite the whole
process
function of the processor to use instead tag dispatching on variant objects.Each single processor message got rewritten as a struct, inheriting from a base templated Process struct, containing only the required data for that process, rather than using the generic structure that ended up needing to spam bitwise operations to pack as many arguments in a byte as possible. This makes things easier to follow and streamlines the addition of new processes:
Process<true>
, if it requires no answer, inherit it fromProcess<false>
processors
variant typebool process(Processors::NewProcess& arg);
function