|
- using System.Runtime.InteropServices;
-
- namespace NPort.Bindings
- {
- public static class Robocraft
- {
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
- public struct FactoryRobotListInfo{
- public uint item_id;
- public string item_name;
- public string item_description;
- public string thumbnail; // url
- public string added_by;
- public string added_by_display_name;
- public string added_date; // ISO date
- public string expiry_date; // ISO date
- public uint cpu;
- public uint total_robot_ranking;
- public uint rent_count;
- public uint buy_count;
- public uint buyable; // bool
- public string removed_date;
- public string ban_date;
- public uint featured; // bool
- public string banner_message;
- public float combat_rating;
- public float cosmetic_rating;
- public string cube_amounts; // JSON as str
- }
-
- [DllImport("libfj.dll", CallingConvention = CallingConvention.Cdecl)]
- static extern void get_factory_front_page(uint size, [In,Out] FactoryRobotListInfo[] array_ptr);
-
- public static FactoryRobotListInfo[] GetFactoryFrontPage()
- {
- uint size = 100;
- FactoryRobotListInfo[] arr = new FactoryRobotListInfo[size];
- get_factory_front_page(size, arr);
- return arr;
- }
- }
- }
|