Skip to content

Feature/plando wip#5

Open
MLSTRM wants to merge 4 commits intoBartz24:devfrom
MLSTRM:feature/plando-wip
Open

Feature/plando wip#5
MLSTRM wants to merge 4 commits intoBartz24:devfrom
MLSTRM:feature/plando-wip

Conversation

@MLSTRM
Copy link
Copy Markdown
Contributor

@MLSTRM MLSTRM commented Sep 11, 2023

No description provided.

Create initial wip / proof of concept for battle plando with json export/import for changes manually
Building out further UI functionality but still having many binding errors
Build out further UI editing functionality
public List<string> Keys => Entries.Keys.ToList();
public List<T> Values => Entries.Values.ToList();

public List<KeyValuePair<string, T>> Entries => Data.Keys.Select(k => KeyValuePair.Create(k, Data[k])).ToList();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might need to change this now that you adjusted how some of the entries stuff works behind the scenes...

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this would need to go through a refactor...hopefully for the better?

return t.GetData(orig ? treasureRando.treasuresOrig[key] : treasureRando.treasures[key]);
case TreasureRando.BattleData b:
BattleRando battleRando = treasureRando.Randomizers.Get<BattleRando>();
if(battleRando == null)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stuff like this is a good argument for having the plando functionality for a sub-randomiser in the same class really since a lot of it ends up being duplicated/shared.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment on the Plandomizer class where we can make an IPlandomizer interface to reuse code and make BattlePlandomizer inherit BattleRandomizer.

That should make it so that Randomizers.Get<BattleRando>() pulls whichever type is loaded (normal rando or plando).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the most part this is basically a clone of BattleRando with some unused stuff taken out. made rebasing easier by accident lol, but argument to be made for putting it back in the main class.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be ok with it being its own class as per other comments.

Copy link
Copy Markdown
Owner

@Bartz24 Bartz24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a good starting point. Primarily need to determine how we should reuse code. Either a separate plando class or just add to the rando class. I'm leaning towards a separate class similar to how it is here.

return new Dictionary<string, HTMLPage>();
}
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably make the Plandomizer an interface and then have each plandomizer inherit from the randomizer and IPlandomizer.
That way we can reuse code in both that does not use the plando.
Ex: class BattlePlandomizer : BattleRandomizer, IPlandomizer

return t.GetData(orig ? treasureRando.treasuresOrig[key] : treasureRando.treasures[key]);
case TreasureRando.BattleData b:
BattleRando battleRando = treasureRando.Randomizers.Get<BattleRando>();
if(battleRando == null)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment on the Plandomizer class where we can make an IPlandomizer interface to reuse code and make BattlePlandomizer inherit BattleRandomizer.

That should make it so that Randomizers.Get<BattleRando>() pulls whichever type is loaded (normal rando or plando).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be ok with it being its own class as per other comments.

public List<string> Keys => Entries.Keys.ToList();
public List<T> Values => Entries.Values.ToList();

public List<KeyValuePair<string, T>> Entries => Data.Keys.Select(k => KeyValuePair.Create(k, Data[k])).ToList();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this would need to go through a refactor...hopefully for the better?

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.

2 participants