geometry-tower-defense/Assets/GameMain/Scripts/Definition/DataStruct/TowerCompItemData.cs

100 lines
2.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
namespace GeometryTD.Definition
{
/// <summary>
/// 背包内组件实例基类(非 DataTable表示玩家持有物
/// </summary>
[Serializable]
public abstract class TowerCompItemData
{
/// <summary>
/// 组件实例唯一 Id。
/// </summary>
public long InstanceId { get; set; }
/// <summary>
/// 组件配置 Id对应 DataTable Id
/// </summary>
public int ConfigId { get; set; }
/// <summary>
/// 组件槽位类型。
/// </summary>
public TowerCompSlotType SlotType { get; protected set; }
/// <summary>
/// 组件名称。
/// </summary>
public string Name { get; set; }
/// <summary>
/// 组件品质。
/// </summary>
public RarityType Rarity { get; set; }
/// <summary>
/// 组件当前耐久0~100
/// </summary>
public float Endurance { get; set; } = 100f;
public bool IsAssembledIntoTower { get; set; }
/// <summary>
/// 组件约束(先沿用 DataTable 原定义)。
/// </summary>
public string Constraint { get; set; }
/// <summary>
/// 组件当前 Tag实例态
/// </summary>
public TagType[] Tags { get; set; }
}
[Serializable]
public sealed class MuzzleCompItemData : TowerCompItemData
{
public MuzzleCompItemData()
{
SlotType = TowerCompSlotType.Muzzle;
}
public int[] AttackDamage { get; set; }
public float DamageRandomRate { get; set; }
public AttackMethodType AttackMethodType { get; set; }
}
[Serializable]
public sealed class BearingCompItemData : TowerCompItemData
{
public BearingCompItemData()
{
SlotType = TowerCompSlotType.Bearing;
}
public float[] RotateSpeed { get; set; }
public float[] AttackRange { get; set; }
}
[Serializable]
public sealed class BaseCompItemData : TowerCompItemData
{
public BaseCompItemData()
{
SlotType = TowerCompSlotType.Base;
}
public float[] AttackSpeed { get; set; }
public AttackPropertyType AttackPropertyType { get; set; }
}
[Serializable]
public sealed class AccessoryItemData : TowerCompItemData
{
public AccessoryItemData()
{
SlotType = TowerCompSlotType.Accessory;
}
}
}