Skip to content

misc: remove internal id.#26

Merged
jsm174 merged 2 commits into
masterfrom
misc/remove-internal-id
May 29, 2022
Merged

misc: remove internal id.#26
jsm174 merged 2 commits into
masterfrom
misc/remove-internal-id

Conversation

@jsm174
Copy link
Copy Markdown
Contributor

@jsm174 jsm174 commented Apr 18, 2022

This PR is a companion to freezy/VisualPinball.Engine#408

It removes the InternalId parameter that is no longer part of switches, lamps, and coils.

A new class PinMameIdAlias was created to associate an integer PinMAME id to a VPE string id. All games and MPUs were updated to support having aliases. For example:

private readonly PinMameIdAlias[] _aliases =
{
new PinMameIdAlias(1, SwCoin1, AliasType.Switch),
new PinMameIdAlias(2, SwCoin2, AliasType.Switch),
new PinMameIdAlias(3, SwCoin3, AliasType.Switch),
new PinMameIdAlias(4, SwCoin4, AliasType.Switch),
new PinMameIdAlias(5, SwCancel, AliasType.Switch),
new PinMameIdAlias(6, SwDown, AliasType.Switch),
new PinMameIdAlias(7, SwUp, AliasType.Switch),
new PinMameIdAlias(8, SwEnter, AliasType.Switch),
new PinMameIdAlias(112, SwFlipperLowerRight, AliasType.Switch),
new PinMameIdAlias(114, SwFlipperLowerLeft, AliasType.Switch),
new PinMameIdAlias(116, SwFlipperUpperRight, AliasType.Switch),
new PinMameIdAlias(118, SwFlipperUpperLeft, AliasType.Switch),
new PinMameIdAlias(19, CoilGameOn, AliasType.Coil),
};

Dictionaries that map PinMAME ids to aliases, and aliases to PinMAME ids have been created to allow for fast lookup.

Note: Any existing projects should have the switches, coils, and lamps refreshed. Single digit PinMAME ids were probably two characters (01, 02, 03), and are now single characters (1, 2, 3).

To Do:

@jsm174 jsm174 requested a review from freezy April 18, 2022 18:46
@jsm174 jsm174 merged commit 9ae7e26 into master May 29, 2022
@jsm174 jsm174 deleted the misc/remove-internal-id branch May 29, 2022 11:12
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.

1 participant