Skip to content
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
merged 4 commits into from
Oct 25, 2018

Conversation

tabascq
Copy link
Contributor

@tabascq tabascq commented Oct 21, 2018

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.

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.
@tabascq
Copy link
Contributor Author

tabascq commented Oct 22, 2018

Hey everyone, I think I'm done with this, so it's ready for review. Prerequisite authoring and prerequisite runtime both work!

ServerCore/Pages/Puzzles/Edit.cshtml.cs Show resolved Hide resolved
ServerCore/Pages/Puzzles/Edit.cshtml.cs Outdated Show resolved Hide resolved
Data/DataModel/PuzzleStatePerTeam.cs Show resolved Hide resolved
ServerCore/PuzzleStateHelper.cs Show resolved Hide resolved
ServerCore/PuzzleStateHelper.cs Outdated Show resolved Hide resolved
ServerCore/PuzzleStateHelper.cs Show resolved Hide resolved
/// <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)
Copy link
Contributor

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?

ServerCore/PuzzleStateHelper.cs Show resolved Hide resolved
@tabascq tabascq merged commit 4a13950 into PuzzleServer:master Oct 25, 2018
@tabascq tabascq mentioned this pull request Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants