using System; using System.Collections.Generic; using System.Linq; using System.Text; using HeuristicLab.Core; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; using HeuristicLab.Common; namespace HeuristicLab.PDPSimulation.DomainModel { [StorableClass] public abstract class BaseObject: Item { [Storable] public Guid Id { get; set; } public BaseObject() { Id = Guid.NewGuid(); } [StorableConstructor] protected BaseObject(bool deserializing) : base(deserializing) { } protected BaseObject(BaseObject original, Cloner cloner) : base(original, cloner) { Id = original.Id; } public override bool Equals(object obj) { if (obj is BaseObject) { return Id == (obj as BaseObject).Id; } else { return base.Equals(obj); } } public override int GetHashCode() { return Id.GetHashCode(); } } }