private static UInt32 OnCardReader(UInt32 code, Card.CardData *pData) { Card card = CardsManager.GetCard((int)code); if (card != null) { *pData = card.Data; } return(code); }
public static void Init(string rootPath = ".", string scriptDirectory = "script", string databaseFile = "cards.cdb") { _rootPath = rootPath; _scriptDirectory = scriptDirectory; CardsManager.Init(Path.Combine(Path.GetFullPath(rootPath), databaseFile)); Duel.Duels = new Dictionary <IntPtr, Duel>(); _buffer = Marshal.AllocHGlobal(65536); _cardCallback = OnCardReader; _scriptCallback = OnScriptReader; _messageCallback = OnMessageHandler; set_card_reader(_cardCallback); set_script_reader(_scriptCallback); set_message_handler(_messageCallback); }
public static Card Get(int id) { return(CardsManager.GetCard(id)); }