28 lines
790 B
C#
28 lines
790 B
C#
using System.Collections.Generic;
|
|
namespace Gameplay.Area.AttackArea
|
|
{
|
|
public class AttackAreaPoint
|
|
{
|
|
public int cellIndex;
|
|
public Dictionary<int, AttackAreaData> attackAreaMap;
|
|
|
|
public AttackAreaPoint(int cellIndex)
|
|
{
|
|
this.cellIndex = cellIndex;
|
|
attackAreaMap = new Dictionary<int, AttackAreaData>();
|
|
}
|
|
|
|
public AttackAreaData GetAttackArea(int attackDistance)
|
|
{
|
|
if (attackAreaMap.TryGetValue(attackDistance, out var data))
|
|
{
|
|
return data;
|
|
}
|
|
var newAttackAreaData = new AttackAreaData(cellIndex, attackDistance);
|
|
attackAreaMap.Add(attackDistance, newAttackAreaData);
|
|
return newAttackAreaData;
|
|
}
|
|
|
|
}
|
|
}
|