Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Reflection;
- using System.Runtime.Serialization;
- using System.Text;
- namespace Example.Components
- {
- [DataContract(Name = "Entity", Namespace = "")]
- [KnownType("DerivedTypes")]
- abstract class Entity
- {
- [DataMember(Name = "ID")]
- public int ID { get; set; }
- [DataMember(Name = "Name")]
- public string Name { get; set; }
- public Entity(int ID, string Name)
- {
- this.ID = ID;
- this.Name = Name;
- }
- public static Type[] DerivedTypes()
- {
- return TypeRetriever.GetDerivedTypes(MethodBase.GetCurrentMethod().DeclaringType, Assembly.GetExecutingAssembly());
- }
- }
- }
Add Comment
Please, Sign In to add comment