Skip to content

Add support for crowns as a charge#9

Open
antoineluong wants to merge 1 commit into
blemoine:masterfrom
antoineluong:master
Open

Add support for crowns as a charge#9
antoineluong wants to merge 1 commit into
blemoine:masterfrom
antoineluong:master

Conversation

@antoineluong
Copy link
Copy Markdown

Comment thread src/app/model/charge.ts Outdated
'dovetailed',
'ducal',
'embattled',
];
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.

missing a as const as the end of this declaration

Copy link
Copy Markdown
Owner

@blemoine blemoine left a comment

Choose a reason for hiding this comment

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

Thank you very much, at runtime it works perfectly :)

But I didn't setup a CI (yet ?) , so I have to run manually npm run test, which is showing me some errors:

  • can you run prettier on all committed code ? ( prettier --write src/ )
  • can you fix the type errors (can be seen with npm run typecheck)
    you will need to add in arbitraries.ts in createChargeArb something like
 else if (chargeName === 'crown') {
      return fc.record<Crown>({
        name: fc.constant(chargeName),
        tincture: tinctureArb,
        countAndDisposition: countAndDistionArb,
        type: fc.constantFrom(...crownTypes),
      });
    } 

Aside from that, It's good for me. When fixed, I'll merge.

Thank you again!

@antoineluong
Copy link
Copy Markdown
Author

Thanks for the review. I have two questions about that:

  • where should the adjective be placed (embattled crown or crown embattled)?
  • for future additions, as the possibilities of charge types are quite large, what about a system of plugins with some kind of inheritance to simplify the process?

@blemoine
Copy link
Copy Markdown
Owner

blemoine commented Apr 1, 2020

It's a good question, as it will make the change far more complicated:

  • dancetty and embattled are after the crown,
  • ducal is before the crown.

Here the quick fix could to just not support ducal in the first version, as the parser will need some tweak to be able to support the 2 possible positions

A plugin system is definitely something we could do, but it will take quite a lot a time to implement , so don't expect it very soon...

@antoineluong
Copy link
Copy Markdown
Author

A plugin system is definitely something we could do, but it will take quite a lot a time to implement , so don't expect it very soon...

I could start working on it, if that's OK with you.

@blemoine
Copy link
Copy Markdown
Owner

It's open source, you don't need my permission to work on it :)
On my side, I'm working on another side project right now, so every contribution on this one are more than welcome.

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