[Team] 팀 타입을 enum으로 변경
기존 int teamId를 TeamType enum으로 변경하여 가독성과 타입 안전성 향상 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -2,15 +2,26 @@ using UnityEngine;
|
||||
|
||||
namespace Colosseum
|
||||
{
|
||||
/// <summary>
|
||||
/// 팀 타입 열거형
|
||||
/// </summary>
|
||||
public enum TeamType
|
||||
{
|
||||
None = 0,
|
||||
Player = 1,
|
||||
Enemy = 2,
|
||||
Neutral = 3,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 팀 정보를 관리하는 컴포넌트.
|
||||
/// 캐릭터나 엔티티에 추가하여 팀 구분에 사용합니다.
|
||||
/// </summary>
|
||||
public class Team : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private int teamId = 0;
|
||||
[SerializeField] private TeamType teamType = TeamType.None;
|
||||
|
||||
public int TeamId => teamId;
|
||||
public TeamType TeamType => teamType;
|
||||
|
||||
/// <summary>
|
||||
/// 같은 팀인지 확인
|
||||
@@ -27,7 +38,7 @@ namespace Colosseum
|
||||
// 한쪽만 팀이 없으면 다른 팀
|
||||
if (teamA == null || teamB == null) return false;
|
||||
|
||||
return teamA.TeamId == teamB.TeamId;
|
||||
return teamA.TeamType == teamB.TeamType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user