Search Results

Search found 2 results on 1 pages for 'themarshal'.

Page 1/1 | 1 

  • Converting Luabind to C#?

    - by themarshal
    Has anybody tried converting Luabind to C#? Is such a thing even possible? I've got an application that I want to convert so that it can run in a completely managed environment, but most of the game logic relies upon Lua scripts, and the application uses Luabind to manage the back-and-forth. I'm not familiar enough with Lua or Luabind to know what's involved. Am I on a fool's errand here?

    Read the article

  • List of Lists of different types

    - by themarshal
    One of the data structures in my current project requires that I store lists of various types (String, int, float, etc.). I need to be able to dynamically store any number of lists without knowing what types they'll be. I tried storing each list as an object, but I ran into problems trying to cast back into the appropriate type (it kept recognizing everything as a List<String>). For example: List<object> myLists = new List<object>(); public static void Main(string args[]) { // Create some lists... // Populate the lists... // Add the lists to myLists... for (int i = 0; i < myLists.Count; i++) { Console.WriteLine("{0} elements in list {1}", GetNumElements(i), i); } } public int GetNumElements(int index) { object o = myLists[index]; if (o is List<int>) return (o as List<int>).Count; if (o is List<String>) // <-- Always true!? return (o as List<String>).Count; // <-- Returning 0 for non-String Lists return -1; } Am I doing something incorrectly? Is there a better way to store a list of lists of various types, or is there a better way to determine if something is a list of a certain type?

    Read the article

1