Forum C# Unable to derive from Game class

Unable to derive from Game class

Postby deetmo » August 5th, 2019, 11:15 pm

Why is it impossible to derive from Game class?
When I try to make some general purpose room code in such class:
Code: Select all
public abstract class RoomPlayer : BasePlayer
{}

public abstract class Room<TRoomPlayer> : Game<TRoomPlayer>
    where TRoomPlayer : RoomPlayer, new()
{}

And then:
Code: Select all
public class SomeRoomPlayer : RoomPlayer
{}

[RoomType("SomeRoom")]
public class SomeRoom : Room<SomeRoomPlayer>
{}


SomeRoom is invisible when uploading to PlayerIO services.

What is preety strange, when I have tried making room not abstract - PlayerIO complain about missing RoomType attribute on base class becouse it is not abstract.

Seems like a bug for me...
deetmo
 
Posts: 2
Joined: May 5th, 2019, 10:30 pm

Re: Unable to derive from Game class

Postby deetmo » August 7th, 2019, 8:27 pm

I have found issue in Init method:
Code: Select all
if (this.searchHierarchy(type, (Predicate<System.Type>) (t =>
{
  if (t.BaseType != (System.Type) null && t.BaseType.BaseType != (System.Type) null && (t.BaseType.Assembly != assembly && t.BaseType.BaseType.Name == "BaseGame"))
    return t.BaseType.Namespace.StartsWith("PlayerIO.GameLibrary");
  return false;
})))


Please fix it, as it really blocks making any frameworks using rooms.
deetmo
 
Posts: 2
Joined: May 5th, 2019, 10:30 pm


Return to C#



cron