fix: Eliminates allocations in canned evil timer (#2209)

This commit is contained in:
Kamron Batman 2025-06-02 22:48:14 -10:00 • committed by GitHub
parent 0d2ed60fed
commit ea4080ce0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 145 additions and 146 deletions

View file

@ -15,35 +15,34 @@
using System;
namespace Server.Engines.CannedEvil
namespace Server.Engines.CannedEvil;
public class ChampionEntry
{
public record ChampionEntry
public readonly bool _randomizeType;
public readonly ChampionSpawnType _type;
public readonly Point3D _signLocation;
public readonly Type _champType;
public readonly Map _map;
public readonly Point3D _ejectLocation;
public readonly Map _ejectMap;
public ChampionEntry(Type champtype, Point3D signloc, Map map, Point3D ejectloc, Map ejectmap) :
this(champtype, ChampionSpawnType.Abyss, signloc, map, ejectloc, ejectmap, true)
{
public readonly bool m_RandomizeType;
public readonly ChampionSpawnType m_Type;
public readonly Point3D m_SignLocation;
public readonly Type m_ChampType;
public readonly Map m_Map;
public readonly Point3D m_EjectLocation;
public readonly Map m_EjectMap;
}
public ChampionEntry(Type champtype, Point3D signloc, Map map, Point3D ejectloc, Map ejectmap) :
this(champtype, ChampionSpawnType.Abyss, signloc, map, ejectloc, ejectmap, true)
{
}
public ChampionEntry(
Type champtype, ChampionSpawnType type, Point3D signloc, Map map, Point3D ejectloc, Map ejectmap,
bool randomizetype = false
)
{
m_ChampType = champtype;
m_RandomizeType = randomizetype;
m_Type = type;
m_SignLocation = signloc;
m_Map = map;
m_EjectLocation = ejectloc;
m_EjectMap = ejectmap;
}
public ChampionEntry(
Type champtype, ChampionSpawnType type, Point3D signloc, Map map, Point3D ejectloc, Map ejectmap,
bool randomizetype = false
)
{
_champType = champtype;
_randomizeType = randomizetype;
_type = type;
_signLocation = signloc;
_map = map;
_ejectLocation = ejectloc;
_ejectMap = ejectmap;
}
}