Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Refactor BrainBtnPanel #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Refactor BrainBtnPanel #3

wants to merge 1 commit into from

Conversation

supermario
Copy link
Member

@supermario supermario commented Apr 27, 2016

@benkitzelman not sure if I missed something, but couldn't see why MessageBus was needed here...

I've refactored assuming it was just inexperience with React, but I could have assumed wrong... (if so, sorry! 😨 )

Check it out and let me know if it makes sense or not.

Also minor change using React's refs feature instead of DOM querying.

Señor @owenbyrne may be interested also...

@supermario supermario force-pushed the refactor-brainbutton branch from 50396fc to b75d71c Compare April 27, 2016 16:00
@supermario supermario force-pushed the refactor-brainbutton branch from b75d71c to e54fd9a Compare April 27, 2016 16:10
@benkitzelman
Copy link
Contributor

benkitzelman commented Apr 28, 2016

@supermario as each team has two buttons - the message bus was used to communicate between buttons for a team - ensuring that only one brain for a team is active....

i.e. User clicks on Brain for team Blue, then clicks on Bot for team Blue - both buttons should not be active. There might be a better way to handle this - but I remember you mentioning that the MessageBus was used for communicating between components

@supermario
Copy link
Member Author

@benkitzelman ah sorry, so that's what I missed.

In this case given PlayerBrainPanel contains all the buttons, perhaps we could enforce the click logic at that level.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants