Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infarstructure: Move methods from npc to Character #68666

Merged
merged 4 commits into from
Oct 16, 2023

Conversation

Brambor
Copy link
Contributor

@Brambor Brambor commented Oct 15, 2023

Summary

None

Purpose of change

Closes #68657

Describe the solution

Whatever function I was changing, I read the whole thing to make it mention Characters instead of NPCs where appropriate.

Move methods that are necessary in #68183 from npc to Character (supertype of npc). That PR will require this PR to get merged.
In Character, they are abstract methods.
In npc they are as they used to be.
In Avatar, the code delegates the implementation to the already existing code in npc. Utilizing assumptions that two avatars cannot exist (in which case it would recursively call the other until it crashes from stack overflow).

Describe alternatives you've considered

Testing

Compiling...

Additional context

More methods could be moved

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership Info / User Interface Game - player communication, menus, etc. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Oct 15, 2023
@Brambor Brambor changed the title Subtype Infarstructure: Move methods from npc to Character Oct 15, 2023
@github-actions github-actions bot added the Vehicles Vehicles, parts, mechanics & interactions label Oct 15, 2023
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 15, 2023
@Brambor
Copy link
Contributor Author

Brambor commented Oct 15, 2023

Note! I am assuming here that is_obeying and is_ally is transitive reflexive, so if A is an ally of B then B is an ally of A.

@Maleclypse Maleclypse merged commit f83877a into CleverRaven:master Oct 16, 2023
@Brambor Brambor deleted the subtype branch October 16, 2023 22:35
detahramet pushed a commit to detahramet/Cataclysm-DDA that referenced this pull request Nov 6, 2023
* move is_ally to Character

* move is_obeying to Character

* get_characters_if

* change return val of get_crafting_helpers to Character
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions NPC / Factions NPCs, AI, Speech, Factions, Ownership Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infrastructure: new class Crafter; Character >: Crafter >: (NPC, Avatar)
3 participants