public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); Type = (SBType)reader.ReadInt(); }
/// <summary> /// /// </summary> /// <param name="doc"></param> /// <returns></returns> public static DateTime GetPeriodicDate(Document doc) { var docType = (SBDocumentType)SBType.GetType(doc); switch (docType.Periodicity) { case Periodicity.None: return(DateTimeNow.Now); case Periodicity.Day: return(doc.Date.BeginOfDay()); case Periodicity.Month: return(doc.Date.StartOfMonth()); case Periodicity.Quarter: return(doc.Date.GetQuarterBegin()); case Periodicity.Year: return(doc.Date.StartOfYear()); default: throw new ArgumentOutOfRangeException(); } }
/// <summary> /// /// </summary> public void Initialize() { Validate(); Database.Initialize(); SBType.InitializeTypes(TypesInitializer); IsInitialized = true; }
public void MetadataTestDocument() { var document = new MovementDocument(); Assert.AreEqual(document.TypeId, 4); var documentType = SBType.GetType(document); Assert.IsInstanceOf <SBDocumentType>(documentType); }
public void MetadataTestDetail() { var tab = new TabTestDetail(); Assert.AreEqual(tab.TypeId, 3); var tabType = SBType.GetType(tab); Assert.IsInstanceOf <SBDetailType>(tabType); }
public StoreSingingBall() : base(0x468A) { var values = Enum.GetValues(typeof(SBType)); Type = (SBType)values.GetValue(Utility.Random(values.Length)); Weight = 1.0; LootType = LootType.Regular; SetHue(); }
public void MetadataTestEntity() { var country = new CountryTestEntity(); Assert.AreEqual(country.TypeId, 1); var countryType = SBType.GetType(country); Assert.IsInstanceOf <SBEntityType>(countryType); var city = new CityTestEntity(); Assert.AreEqual(city.TypeId, 2); var cityType = SBType.GetType(city); Assert.IsInstanceOf <CitySBType>(cityType); }
/// <summary> /// /// </summary> /// <returns></returns> protected override long GetTypeId() { return(SBType.GetTypeId(this)); }
public void InitializeMetadata() { SBType.Initializer = new SBTypeTestInitializer(); SBType.InitializeTypes(); }