using System.Collections.Concurrent; using Axion.Collections.Concurrent; using Google.Protobuf.WellKnownTypes; using MetaAssets; using ServerCore; using ServerBase; namespace ServerCommon; //파일럿이라 무시하고 이쪽에 넣는다... public class BattleInstancesObject { public EBattleObjectType m_type = EBattleObjectType.None; public string m_anchor_guid { get; set; } = string.Empty; public DateTime m_active_time { get; set; } = DateTimeHelper.Current; public bool m_is_active { get; set; } = true; public BattleInstancesObject(EBattleObjectType type, string guid) { m_type = type; m_anchor_guid = guid; } public BattleInstancesObject(EBattleObjectType type, string guid, bool isActive) { m_type = type; m_anchor_guid = guid; m_is_active = isActive; } } public class BattleObjectPodStorage : BattleInstancesObject { public Int32 m_reward_cnt { get; set; } = 0; public BattleObjectPodStorage(string anchorGuid) : base(EBattleObjectType.Pod_Combat, anchorGuid) { } } public class BattleObjectEmpty : BattleInstancesObject { public BattleObjectEmpty() : base(EBattleObjectType.None, string.Empty) { } } public class BattleObjectPodCombat : BattleInstancesObject { private ECombatPodType m_combat_pod_type { get; } = ECombatPodType.Pod; public string m_source_storage_anchor_guid { get; set; } = string.Empty; //pod 발생된 스토리지의 anchor guid public PodCombatStateType m_state { get; set; } = PodCombatStateType.Active; //warn : 이름 바꾸려면 클라랑 협의 public DateTime m_state_change_time { get; set; } = DateTimeHelper.Current; //이게 상태에 따라 획득한 시간으로도 쓴다. public Pos m_currenct_Pos { get; set; } = new(); public string m_current_occupier_guid { get; set; } = string.Empty; public DateTime m_occupied_time { get; set; } = DateTimeHelper.Current; //이게 상태에 따라 획득한 시간으로도 쓴다. public BattleObjectPodCombat(): base(EBattleObjectType.Pod_Combat, string.Empty, false) { } public BattleObjectPodCombat(string anchorGuid, string sourceAnchorGuid, DateTime startTime) : base(EBattleObjectType.Pod_Combat, anchorGuid, false) { m_source_storage_anchor_guid = sourceAnchorGuid; m_state = PodCombatStateType.Active; m_active_time = startTime; init(); } public void init() { m_is_active = true; } public void changeDropState( Pos pos) { m_state = PodCombatStateType.Dropped; m_state_change_time = DateTimeHelper.Current; m_currenct_Pos = pos; m_current_occupier_guid = string.Empty; } public void setDeactive() { m_state = PodCombatStateType.DeActive; m_state_change_time = DateTimeHelper.Current; m_currenct_Pos = new(); m_current_occupier_guid = String.Empty; } public void setActive(DateTime t) { m_state = PodCombatStateType.Active; m_state_change_time = t; m_active_time = t; m_currenct_Pos = new(); m_current_occupier_guid = String.Empty; m_occupied_time = DateTimeHelper.Current; } } public class BattleObjectPickupPod : BattleInstancesObject { //public bool m_has_reward = false; public BattleObjectPickupPod(string anchorGuid) : base(EBattleObjectType.Pod_Box, anchorGuid) { } // public BattleObjectPickupPod(string anchorGuid, bool isActive) : base(EBattleObjectType.Pod_Box, anchorGuid) // { // m_is_active = isActive; // } public BattleObjectPickupPod clone() { BattleObjectPickupPod new_pod = new(m_anchor_guid); new_pod.m_type = m_type; new_pod.m_active_time = m_active_time; new_pod.m_is_active = m_is_active; return new_pod; } } public class BattleObjectWeapon : BattleInstancesObject { //뭐가 필요할까? public BattleObjectWeapon(string anchorGuid) : base(EBattleObjectType.Weapon, anchorGuid) { } public BattleObjectWeapon clone() { BattleObjectWeapon new_weapon = new(m_anchor_guid); new_weapon.m_type = m_type; new_weapon.m_active_time = m_active_time; new_weapon.m_is_active = m_is_active; return new_weapon; } } public class BattleObjectBuff : BattleInstancesObject { //뭐가 필요할까? public BattleObjectBuff(string anchorGuid) : base(EBattleObjectType.Buff, anchorGuid) { } public BattleObjectBuff clone() { BattleObjectBuff new_buff = new(m_anchor_guid); new_buff.m_type = m_type; new_buff.m_active_time = m_active_time; new_buff.m_is_active = m_is_active; return new_buff; } } public class BattleTacticalBoardInfo { //누굴 죽이고 누구한테 죽였는지는 로그를 남긴다. public string m_user_guid { get; private set; } = string.Empty; public Int32 m_kill_count { get; set; } = 0; public Int32 m_Death_count { get; set; } = 0; public Int32 m_Pod_count { get; set; } = 0; public BattleTacticalBoardInfo(string userGuid) { m_user_guid = userGuid; } public BattleTacticalBoardInfo clone() { BattleTacticalBoardInfo new_info = new(m_user_guid); new_info.m_kill_count = m_kill_count; new_info.m_Death_count = m_Death_count; new_info.m_Pod_count = m_Pod_count; return new_info; } } public class PickupPodGeneratedInfo { public int m_group_id { get; set; } = 0; public int m_idx { get; set; } = 0; public string m_anchor_guid { get; set; } = string.Empty; //픽업포드 anchor_guid public string m_before_anchor_guid { get; set; } = string.Empty; //이전에 활성화 됏던 anchor_guid public DateTime m_next_generate_time { get; set; } = DateTimeHelper.Current; //다음 보상 받을 시간 public PickupPodGeneratedInfo(int groupId, int idx, string newAnchorGuid, string beforeAnchorGuid, DateTime nextGenerateTime) { m_group_id = groupId; m_idx = idx; m_anchor_guid = newAnchorGuid; m_before_anchor_guid = beforeAnchorGuid; m_next_generate_time = nextGenerateTime; } public PickupPodGeneratedInfo clone() { PickupPodGeneratedInfo clone = new(m_group_id, m_idx, m_anchor_guid, m_before_anchor_guid, m_next_generate_time); return clone; } }