Created
April 29, 2012 00:14
-
-
Save samneirinck/2522840 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace CryEngine | |
{ | |
/// <summary> | |
/// ItemSystem contains scriptbinds used in relation to the item system. | |
/// </summary> | |
public class ItemSystem | |
{ | |
private static IItemSystemMethods _itemSystemMethods; | |
internal static IItemSystemMethods Methods { | |
get | |
{ | |
return _itemSystemMethods ?? (_itemSystemMethods = new NativeItemSystemMethods()); | |
} | |
set | |
{ | |
_itemSystemMethods = value; | |
} | |
} | |
private class NativeItemSystemMethods : IItemSystemMethods | |
{ | |
[MethodImplAttribute(MethodImplOptions.InternalCall)] | |
extern void CacheItemGeometry(string itemClass); | |
[MethodImplAttribute(MethodImplOptions.InternalCall)] | |
extern void CacheItemSound(string itemClass); | |
[MethodImplAttribute(MethodImplOptions.InternalCall)] | |
extern void _GiveItem(uint entityId, string itemClass); | |
[MethodImplAttribute(MethodImplOptions.InternalCall)] | |
extern void _GiveEquipmentPack(uint entityId, string equipmentPack); | |
} | |
public static void GiveItem(EntityId actorId, string itemClass) | |
{ | |
Methods._GiveItem(actorId, itemClass); | |
} | |
public static void GiveEquipmentPack(EntityId actorId, string equipmentPack) | |
{ | |
Methods._GiveEquipmentPack(actorId, equipmentPack); | |
} | |
} | |
public interface IItemSystemMethods | |
{ | |
void CacheItemGeometry(string itemClass); | |
void CacheItemSound(string itemClass); | |
void _GiveItem(uint entityId, string itemClass); | |
void _GiveEquipmentPack(uint entityId, string equipmentPack); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment