Advertisement
jewalky

Untitled

Feb 15th, 2017
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. class UnrelatedClass abstract
  2. {
  3.     string s;
  4.  
  5.    
  6.     static UnrelatedClass Create()
  7.     {
  8.         UnrelatedClass instance = new();
  9.         instance.s = "test";
  10.         return instance;
  11.     }
  12. }
  13.  
  14. class TestInventory : Inventory
  15. {
  16.     override bool DrawPowerup(int x, int y)
  17.     {
  18.         UnrelatedClass cls2 = UnrelatedClass.Create(); // should work
  19.         Console.Printf("created cls2, cls2.s = %s", cls2.s);
  20.         UnrelatedClass cls = new('UnrelatedClass'); // should fail
  21.         Console.Printf("created cls"); // shouldn't get to this point
  22.    
  23.         textureID tx = TexMan.CheckForTexture("M_DOOM", TexMan.TYPE_Any); // should work
  24.         Screen.DrawHUDTexture(tx, 0, 0); // should work
  25.         return true;
  26.     }
  27. }
  28.  
  29. struct LelStruct
  30. {
  31.     void MakeUnrelatedClass()
  32.     {
  33.         new(); // this should fail horribly
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement