Open abrad45 opened 2 years ago
With your approval, I'd like to institute the following terminological changes:
realm
s, but not when referring to their order in the game (see realm order)[0, 8]
) of a realm relative to other realms. We will not index these per realm (0
, 1
or 2
) because it makes referring to each realm more complex (realm [0,2]
or realm [1,0]
).import React, { useState } from "react";
import realms from "realms";
import "./RealmSelector.scss";
const RealmSelector = ({ realmIndex, realmName, updateRealm }) => {
const [isRealmSelectorOpen, setIsRealmSelectorOpen] = useState(
false,
);
const toggleRealmSelector = () => {
setIsRealmSelectorOpen(!isRealmSelectorOpen);
};
return (
<>
<button
className="realmHeader"
type="button"
onClick={() => toggleRealmSelector()}
>
<h2>{realmName}</h2>
</button>
{isRealmSelectorOpen && (
<div className="realmSelector">
{realms.map((realm) => {
return (
<button
className="realmOption"
key={`${realm.id}-selector`}
type="button"
onClick={() => updateRealm(realm, realmIndex)}
>
{realm.name}
</button>
);
})}
</div>
)}
</>
);
};
export default RealmSelector;
Is there anything else we need precise terminology for?
Also, are you concerned about the size of the commit(s) that come from this? I can try to make them small (or, say, do each of these separately) but that will add overhead versus just... doing the thing 😬
This looks good! I'm not quite sure what you mean by "Realm Index" not being per realm, if you could explain that more. 🤔
I think just doing the thing is fine too.
As far as other terminology, I think this is good for now. When we get more into scoring we'll have to think about things like "points", "stars", "resources", and maybe "turns", but that's not really necessary yet.
This looks good! I'm not quite sure what you mean by "Realm Index" not being per realm, if you could explain that more. 🤔
Realms could be indexed relative to the game 0-8
or relative to the round 0-2
. If we index them relative to the game, referring to any realm can be done with a simple index, 0-8
. If we index them relative to the round, however, we'd need to reference each realm as [0, 1]
or [2, 0]
([round, realmIndex]
). Just trying to avoid the 2D array :)
Cleanup task to clarify what is being referenced throughout the codebase