Guest User

Untitled

a guest
Nov 20th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. using Microsoft.Xna.Framework;
  2. using Microsoft.Xna.Framework.Graphics;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Reflection;
  7. using System.Runtime.Serialization;
  8. using System.Text;
  9.  
  10. namespace Example.Components
  11. {
  12.  
  13. [DataContract(Name = "Entity", Namespace = "")]
  14. [KnownType("DerivedTypes")]
  15. abstract class Entity
  16. {
  17.  
  18. [DataMember(Name = "ID")]
  19. public int ID { get; set; }
  20.  
  21. [DataMember(Name = "Name")]
  22. public string Name { get; set; }
  23.  
  24. public Entity(int ID, string Name)
  25. {
  26. this.ID = ID;
  27. this.Name = Name;
  28. }
  29.  
  30. public static Type[] DerivedTypes()
  31. {
  32. return TypeRetriever.GetDerivedTypes(MethodBase.GetCurrentMethod().DeclaringType, Assembly.GetExecutingAssembly());
  33. }
  34.  
  35. }
  36. }
Add Comment
Please, Sign In to add comment