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

A player has a gender #67

Open
TheoPannetier opened this issue Feb 14, 2024 · 0 comments
Open

A player has a gender #67

TheoPannetier opened this issue Feb 14, 2024 · 0 comments

Comments

@TheoPannetier
Copy link
Contributor

TheoPannetier commented Feb 14, 2024

A player has a gender, either male or female.

Tip: if you are confused by the gender::female syntax, look up enum classes or ask a medior.

// 67 - A player has a gender
    {
        player p; // players are female by default so we don't have to specify every time
        assert(p.get_gender() == gender::female);

        p = player(gender::male); // but gender can be set at construction
        assert(p.get_gender() == gender::male);

        p.set_gender(gender::female); // gender can be set e.g. through options
        assert(p.get_gender() == gender::female);
    }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants