Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 IronRuby 进行一些 XNA 开发,但在泛型(加载)和访问一些基类属性(如 Content)方面遇到了困难。
有什么提示吗?
关于泛型 - 如果要创建泛型对象,请使用方括号来定义泛型类型。例如:
list = System::Collections::Generic::List[System::String].new
关于基类属性,Ruby 中没有“base”关键字,因此您可以使用“self”或直接调用方法或属性。您也可以尝试修改属性名称(例如,HelloWorld 被修改为 hello_world)。我建议为了访问 Content 属性,只需这样调用它:
self.content
希望它有所帮助,谢伊。