* simple storeship arriving * pupu * ship cycling * buy positions prototypes * i hate UI * PriceControl * second tab ui * baloon! pallets! * update shop in town * setup billboard timer * split to sell and buy categories * renaming gaming * actually selling * fix infinity selling * improve timer * move description too rigt part UI * bar selling * iron cabinet * purge currency categories * remove town balance, add money box * special proposal, FTLImmune anchor * fix UI * remove tests buying * Update CP14StoreWindow.xaml.cs * currency converter * currency clean up * Update CP14CargoSystem.cs * clean up part 2 * rider petpet * coins audio * coin improvment * Update coins.yml * translate * more coins roundstart * Update wallet.yml * Update wallet.yml * generate coin problem fix * refactor proto reading * fixes * huh * shuttle logshit fix, add to tavern map * Update CP14StationTravelingStoreShipTargetComponent.cs
65 lines
1.7 KiB
C#
65 lines
1.7 KiB
C#
using Content.Shared._CP14.Workbench;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Content.Shared._CP14.TravelingStoreShip;
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum CP14StoreUiKey
|
|
{
|
|
Key,
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed class CP14StoreUiState : BoundUserInterfaceState
|
|
{
|
|
public readonly HashSet<CP14StoreUiProductEntry> ProductsBuy;
|
|
public readonly HashSet<CP14StoreUiProductEntry> ProductsSell;
|
|
|
|
public bool OnStation;
|
|
public readonly TimeSpan NextTravelTime;
|
|
|
|
public CP14StoreUiState(HashSet<CP14StoreUiProductEntry> productsBuy, HashSet<CP14StoreUiProductEntry> productsSell, bool onStation, TimeSpan time)
|
|
{
|
|
ProductsBuy = productsBuy;
|
|
ProductsSell = productsSell;
|
|
OnStation = onStation;
|
|
NextTravelTime = time;
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public readonly struct CP14StoreUiProductEntry : IEquatable<CP14StoreUiProductEntry>
|
|
{
|
|
public readonly string ProtoId;
|
|
public readonly SpriteSpecifier Icon;
|
|
public readonly string Name;
|
|
public readonly string Desc;
|
|
public readonly int Price;
|
|
|
|
public CP14StoreUiProductEntry(string protoId, SpriteSpecifier icon, string name, string desc, int price)
|
|
{
|
|
ProtoId = protoId;
|
|
Icon = icon;
|
|
Name = name;
|
|
Desc = desc;
|
|
Price = price;
|
|
}
|
|
|
|
public bool Equals(CP14StoreUiProductEntry other)
|
|
{
|
|
return ProtoId == other.ProtoId;
|
|
}
|
|
|
|
public override bool Equals(object? obj)
|
|
{
|
|
return obj is CP14StoreUiProductEntry other && Equals(other);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return HashCode.Combine(ProtoId, Icon, Name, Desc, Price);
|
|
}
|
|
}
|