-
Notifications
You must be signed in to change notification settings - Fork 32
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
Dev/kennyy/prequisite editing #93
Merged
tabascq
merged 4 commits into
PuzzleServer:master
from
tabascq:dev/kennyy/PrequisiteEditing
Oct 25, 2018
Merged
Dev/kennyy/prequisite editing #93
tabascq
merged 4 commits into
PuzzleServer:master
from
tabascq:dev/kennyy/PrequisiteEditing
Oct 25, 2018
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
Allows prerequisites to be edited on the puzzle's Edit page. I've chosen to put them here rather than on their own page, which would have been a bit easier. This is the page they were edited on in the old site, and it was helpful to see the chosen prerequisites next to the min count to make sure that everything lined up.
In preparation for prerequisite-based unlocking, force all setters of unlock/solved state do do their set operations via PuzzleStateHelper, so that we can ultimately use that to perform the prerequisite unlock. I also removed the IsUnlocked and IsSolved bools from PuzzleStatePerTeam to discourage others from using these, since they don't perform well in queries. Finally, I fixed all compiler messages in files I touched - all just cosmetic stuff.
Hey everyone, I think I'm done with this, so it's ready for review. Prerequisite authoring and prerequisite runtime both work! |
jenetlan
reviewed
Oct 23, 2018
jenetlan
reviewed
Oct 23, 2018
morganbr
approved these changes
Oct 23, 2018
ServerCore/PuzzleStateHelper.cs
Outdated
/// <param name="team">The team that just solved; if null, all the teams in the event.</param> | ||
/// <param name="unlockTime">The time that the puzzle should be marked as unlocked.</param> | ||
/// <returns></returns> | ||
private static async Task UnlockIfPrequisitesMetAsync(PuzzleServerContext context, Event eventObj, Puzzle puzzleJustSolved, Team team, DateTime unlockTime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asyasky, I think this has some performance risk since it's O(puzzles^2*teams). Do you have ideas on how to get a read on that?
Closed
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.
Commit 1: Prerequisite Editing
Allows prerequisites to be edited on the puzzle's Edit page. I've chosen to put them here rather than on their own page, which would have been a bit easier. This is the page they were edited on in the old site, and it was helpful to see the chosen prerequisites next to the min count to make sure that everything lined up.
Commit 2: Consolidate all state setters into PuzzleStateHelper
In preparation for prerequisite-based unlocking, force all setters of unlock/solved state do do their set operations via PuzzleStateHelper, so that we can ultimately use that to perform the prerequisite unlock.
I also removed the IsUnlocked and IsSolved bools from PuzzleStatePerTeam to discourage others from using these, since they don't perform well in queries.
Finally, I fixed all compiler messages in files I touched - all just cosmetic stuff.