justindwyer6 / rolling-realms

A fan-made, web-based version of Stonemaier Games' roll-and-write game.
https://rolling-realms.netlify.app
18 stars 3 forks source link

Replace "minigame" terminology with realms #62

Open abrad45 opened 2 years ago

abrad45 commented 2 years ago

Cleanup task to clarify what is being referenced throughout the codebase

abrad45 commented 2 years ago

With your approval, I'd like to institute the following terminological changes:

Example code:

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;
abrad45 commented 2 years ago

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 😬

justindwyer6 commented 2 years ago

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.

abrad45 commented 2 years ago

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 :)