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

[Refactor] gen_flagsをFlagGroup<TRG>クラスに変更 #489

Merged
merged 3 commits into from Mar 13, 2021

Conversation

iks3
Copy link
Contributor

@iks3 iks3 commented Mar 13, 2021

#253#192#279 の前段階として実装しました。
呪い系エゴが上質確定ドロップでは落ちなくなります。
また、追加能力のフラグを増やしやすくなります。

@iks3 iks3 added the enhancement New feature or request label Mar 13, 2021
@iks3 iks3 added this to the 3.0.0Alpha11Release milestone Mar 13, 2021
@iks3 iks3 self-assigned this Mar 13, 2021
メソッドではなくサービス関数で処理するのが相応しいので、
静的メンバ関数にする。
countとatでは2回検索して非効率なので、findで存在を調べて
setはfindで見つけたイテレータで処理する。
string_viewに渡す時はstringクラスにする必要が無いので、
生成のコストをカットできるようにconcptrのまま渡す。
@iks3
Copy link
Contributor Author

iks3 commented Mar 13, 2021

コラボのマージとリファクタリングしました。

@@ -248,7 +248,7 @@ static void analyze_addition(object_type *o_ptr, char *addition)
{
artifact_type *a_ptr = &a_info[o_ptr->name1];
strcpy(addition, "");
if (a_ptr->gen_flags.has(TRG::XTRA_POWER) && a_ptr->gen_flags.has(TRG::XTRA_H_RES)) {
if (a_ptr->gen_flags.has_any_of({ TRG::XTRA_POWER, TRG::XTRA_H_RES })) {
strcat(addition, _("能力and耐性", "Ability and Resistance"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&& なので、has_all_ofですね。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... 直しました。

@iks3 iks3 force-pushed the feature-gen-flags-to-flaggroup branch from 1bbf6c5 to b72d9d7 Compare March 13, 2021 13:51
Copy link
Member

@habu1010 habu1010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他は問題なしです。
Approveかけます。お疲れさまでした。

@iks3 iks3 merged commit 49524e8 into hengband:develop Mar 13, 2021
@iks3 iks3 deleted the feature-gen-flags-to-flaggroup branch March 13, 2021 14:55
sikabane-works added a commit to sikabane-works/hengband that referenced this pull request Jun 7, 2021
[Add] 古ウルクの士官追加と古ウルクの傭兵調整.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

None yet

2 participants