| 123456789101112131415161718192021222324252627282930 |
- using MongoDB.Bson.Serialization.Attributes;
- namespace Hotfix
- {
- public abstract class Component : Disposer
- {
- [BsonIgnore]
- public Entity Parent { get; set; }
- public T GetParent<T>() where T : Entity
- {
- return this.Parent as T;
- }
- protected Component()
- {
- this.Id = 1;
- }
- public override void Dispose()
- {
- if (this.Id == 0)
- {
- return;
- }
- base.Dispose();
- }
- }
- }
|