<commit_before>#pragma once
#include "game/assets/ids/asset_ids.h"
#include "game/enums/item_holding_stance.h"

#include "augs/misc/enum/enum_array.h"

struct stance_animations {
	// GEN INTROSPECTOR struct stance_animations
	assets::torso_animation_id carry;
	assets::torso_animation_id shoot;
	// END GEN INTROSPECTORS

	const assets::torso_animation_id& get_chambering() const;
	const assets::torso_animation_id& get_reloading() const;
};

template <class C>
auto calc_stance_id(
	const C& cosm,
	const augs::constant_size_vector<entity_id, 2>& wielded_items
) {
	const auto n = wielded_items.size();

	if (n == 0) {
		return item_holding_stance::BARE_LIKE;
	}

	if (n == 2) {
		return item_holding_stance::AKIMBO;
	}

	const auto w = cosm[wielded_items[0]];
	return w.template get<invariants::item>().holding_stance;
}

namespace invariants {
	struct torso {
		// GEN INTROSPECTOR struct invariants::torso
		augs::enum_array<stance_animations, item_holding_stance> stances;

		assets::legs_animation_id forward_legs;
		assets::legs_animation_id strafe_legs;

		unsigned min_strafe_facing = 50;
		unsigned max_strafe_facing = 130;
<commit_msg>If both items are held in bare-like stance, choose bare rather than akimbo<commit_after>#pragma once
#include "game/assets/ids/asset_ids.h"
#include "game/enums/item_holding_stance.h"

#include "augs/misc/enum/enum_array.h"

struct stance_animations {
	// GEN INTROSPECTOR struct stance_animations
	assets::torso_animation_id carry;
	assets::torso_animation_id shoot;
	// END GEN INTROSPECTORS

	const assets::torso_animation_id& get_chambering() const;
	const assets::torso_animation_id& get_reloading() const;
};

template <class C>
auto calc_stance_id(
	const C& cosm,
	const augs::constant_size_vector<entity_id, 2>& wielded_items
) {
	const auto n = wielded_items.size();

	if (n == 0) {
		return item_holding_stance::BARE_LIKE;
	}

	auto stance_of = [&](const auto i) {
		const auto w = cosm[wielded_items[i]];
		return w.template get<invariants::item>().holding_stance;
	};

	if (n == 2) {
		if (stance_of(0) == item_holding_stance::BARE_LIKE
			&& stance_of(1) == item_holding_stance::BARE_LIKE
		) {
			return item_holding_stance::BARE_LIKE;
		}

		return item_holding_stance::AKIMBO;
	}

	return stance_of(0);
}

namespace invariants {
	struct torso {
		// GEN INTROSPECTOR struct invariants::torso
		augs::enum_array<stance_animations, item_holding_stance> stances;

		assets::legs_animation_id forward_legs;
		assets::legs_animation_id strafe_legs;

		unsigned min_strafe_facing = 50;
		unsigned max_strafe_facing = 130;

{'fraction_non_alphanumeric': 0.10895696006203955, 'fraction_numerical': 0.0077549437766576195, 'mean_word_length': 5.683937823834197, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6423230', 'n_tokens_mistral': 1022, 'n_tokens_neox': 931, 'n_words': 192}