From 4ff9722e1142bd4735645aebc897d4cc1550396a Mon Sep 17 00:00:00 2001 From: salix5 Date: Sun, 15 Dec 2024 17:35:28 +0800 Subject: [PATCH] move check_playerid to common.h --- common.h | 4 ++++ field.cpp | 4 ---- field.h | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common.h b/common.h index 2c521a2e6..ecda182a7 100644 --- a/common.h +++ b/common.h @@ -12,6 +12,10 @@ #include typedef unsigned char byte; +inline bool check_playerid(int32_t playerid) { + return playerid >= 0 && playerid <= 1; +} + #define MATCH_ALL(x,y) (((x)&(y))==(y)) #define MATCH_ANY(x,y) ((x)&(y)) #define ADD_BIT(x,y) ((x)|=(y)) diff --git a/field.cpp b/field.cpp index 0e5d71281..941acfccc 100644 --- a/field.cpp +++ b/field.cpp @@ -13,10 +13,6 @@ #include "interpreter.h" #include -bool check_playerid(int32_t playerid) { - return playerid >= 0 && playerid <= 1; -} - int32_t field::field_used_count[32] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5}; bool chain::chain_operation_sort(const chain& c1, const chain& c2) { diff --git a/field.h b/field.h index 372fe280b..bd18cdcfa 100644 --- a/field.h +++ b/field.h @@ -33,8 +33,6 @@ class effect; using effect_vector = std::vector; -bool check_playerid(int32_t playerid); - struct tevent { card* trigger_card{ nullptr }; group* event_cards{ nullptr };