mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-08-03 00:01:57 +02:00
added pool/spawn/genus mod loading
- moved ai helper classes to own folder
This commit is contained in:
parent
ce5030acd1
commit
da621dfc0e
19 changed files with 484 additions and 138 deletions
58
FFXIVClassic Map Server/actors/chara/ModifierList.cs
Normal file
58
FFXIVClassic Map Server/actors/chara/ModifierList.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FFXIVClassic_Map_Server.actors.chara.npc;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.chara
|
||||
{
|
||||
class ModifierListEntry
|
||||
{
|
||||
public uint id;
|
||||
public Int64 value;
|
||||
|
||||
public ModifierListEntry(uint id, Int64 value)
|
||||
{
|
||||
this.id = id;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
class ModifierList
|
||||
{
|
||||
public Dictionary<uint, ModifierListEntry> modList;
|
||||
public Dictionary<uint, ModifierListEntry> mobModList;
|
||||
|
||||
public ModifierList(uint id)
|
||||
{
|
||||
modList = new Dictionary<uint, ModifierListEntry>();
|
||||
mobModList = new Dictionary<uint, ModifierListEntry>();
|
||||
}
|
||||
|
||||
public void AddModifier(uint id, Int64 val, bool isMobMod)
|
||||
{
|
||||
var list = isMobMod ? mobModList : modList;
|
||||
list.Add(id, new ModifierListEntry(id, val));
|
||||
}
|
||||
|
||||
public void SetModifier(uint id, Int64 val, bool isMobMod)
|
||||
{
|
||||
var list = isMobMod ? mobModList : modList;
|
||||
if (list.ContainsKey(id))
|
||||
list[id].value = val;
|
||||
else
|
||||
list.Add(id, new ModifierListEntry(id, val));
|
||||
}
|
||||
|
||||
public Int64 GetModifier(uint id, bool isMobMod)
|
||||
{
|
||||
ModifierListEntry retVal;
|
||||
var list = isMobMod ? mobModList : modList;
|
||||
if (!list.TryGetValue(id, out retVal))
|
||||
return 0;
|
||||
|
||||
return retVal.value;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue