Files
abysmal-isle/Scripts/Services/Town Cryer/TownCryerCityEntry.cs
Unstable Kitsune b918192e4e Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
2023-11-28 23:20:26 -05:00

48 lines
1.3 KiB
C#

using Server;
using System;
using Server.Engines.CityLoyalty;
namespace Server.Services.TownCryer
{
public class TownCryerCityEntry
{
public string Title { get; set; }
public string Body { get; set; }
public string Author { get; set; }
public DateTime Expires { get; set; }
public City City { get; set; }
public bool Expired { get { return Expires < DateTime.Now; } }
public TownCryerCityEntry(Mobile author, City city, int duration, string title, string body)
{
Author = author.Name;
Expires = DateTime.Now + TimeSpan.FromDays(duration);
Title = title;
Body = body;
City = city;
}
public void Serialize(GenericWriter writer)
{
writer.Write(0);
writer.Write(Title);
writer.Write(Body);
writer.Write(Expires);
writer.Write(Author);
writer.Write((int)City);
}
public TownCryerCityEntry(GenericReader reader)
{
int version = reader.ReadInt();
Title = reader.ReadString();
Body = reader.ReadString();
Expires = reader.ReadDateTime();
Author = reader.ReadString();
City = (City)reader.ReadInt();
}
}
}