first commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
namespace ClassicAssist.Data.Vendors
|
||||
{
|
||||
public class SellListEntry
|
||||
{
|
||||
public int Amount { get; set; }
|
||||
public int Hue { get; set; }
|
||||
public int ID { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Price { get; set; }
|
||||
public int Serial { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using ClassicAssist.UO.Objects;
|
||||
|
||||
namespace ClassicAssist.Data.Vendors
|
||||
{
|
||||
public class ShopListEntry
|
||||
{
|
||||
public int Amount { get; set; }
|
||||
public Item Item { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Price { get; set; }
|
||||
public int VendorSerial { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows.Input;
|
||||
using ClassicAssist.Annotations;
|
||||
|
||||
namespace ClassicAssist.Data.Vendors
|
||||
{
|
||||
public class VendorBuyAgentEntry : INotifyPropertyChanged
|
||||
{
|
||||
private int _amount;
|
||||
private bool _enabled;
|
||||
private int _graphic;
|
||||
private int _hue;
|
||||
private int _maxPrice;
|
||||
private string _name;
|
||||
|
||||
public int Amount
|
||||
{
|
||||
get => _amount;
|
||||
set => SetProperty( ref _amount, value );
|
||||
}
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
get => _enabled;
|
||||
set => SetProperty( ref _enabled, value );
|
||||
}
|
||||
|
||||
public int Graphic
|
||||
{
|
||||
get => _graphic;
|
||||
set => SetProperty( ref _graphic, value );
|
||||
}
|
||||
|
||||
public int Hue
|
||||
{
|
||||
get => _hue;
|
||||
set => SetProperty( ref _hue, value );
|
||||
}
|
||||
|
||||
public int MaxPrice
|
||||
{
|
||||
get => _maxPrice;
|
||||
set => SetProperty( ref _maxPrice, value );
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
set => SetProperty( ref _name, value );
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged( [CallerMemberName] string propertyName = null )
|
||||
{
|
||||
PropertyChanged?.Invoke( this, new PropertyChangedEventArgs( propertyName ) );
|
||||
}
|
||||
|
||||
// ReSharper disable once RedundantAssignment
|
||||
public virtual void SetProperty<T>( ref T obj, T value, [CallerMemberName] string propertyName = "" )
|
||||
{
|
||||
obj = value;
|
||||
OnPropertyChanged( propertyName );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows.Input;
|
||||
using ClassicAssist.Annotations;
|
||||
|
||||
namespace ClassicAssist.Data.Vendors
|
||||
{
|
||||
public class VendorSellAgentEntry : INotifyPropertyChanged
|
||||
{
|
||||
private int _amount;
|
||||
private bool _enabled;
|
||||
private int _graphic;
|
||||
private int _hue;
|
||||
private int _minPrice;
|
||||
private string _name;
|
||||
|
||||
public int Amount
|
||||
{
|
||||
get => _amount;
|
||||
set => SetProperty( ref _amount, value );
|
||||
}
|
||||
|
||||
public bool Enabled
|
||||
{
|
||||
get => _enabled;
|
||||
set => SetProperty( ref _enabled, value );
|
||||
}
|
||||
|
||||
public int Graphic
|
||||
{
|
||||
get => _graphic;
|
||||
set => SetProperty( ref _graphic, value );
|
||||
}
|
||||
|
||||
public int Hue
|
||||
{
|
||||
get => _hue;
|
||||
set => SetProperty( ref _hue, value );
|
||||
}
|
||||
|
||||
public int MinPrice
|
||||
{
|
||||
get => _minPrice;
|
||||
set => SetProperty( ref _minPrice, value );
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
set => SetProperty( ref _name, value );
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged( [CallerMemberName] string propertyName = null )
|
||||
{
|
||||
PropertyChanged?.Invoke( this, new PropertyChangedEventArgs( propertyName ) );
|
||||
}
|
||||
|
||||
// ReSharper disable once RedundantAssignment
|
||||
public virtual void SetProperty<T>( ref T obj, T value, [CallerMemberName] string propertyName = "" )
|
||||
{
|
||||
obj = value;
|
||||
OnPropertyChanged( propertyName );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using System.Collections.Generic;
|
||||
using ClassicAssist.UO.Objects;
|
||||
|
||||
namespace ClassicAssist.Data.Vendors
|
||||
{
|
||||
public class XYComparer : IComparer<Item>
|
||||
{
|
||||
public int Compare( Item x, Item y )
|
||||
{
|
||||
if ( x == null && y == null )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( x == null )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( y == null )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( x.X > y.X )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( y.X > x.X )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( x.X != y.X )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( x.Y > y.Y )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( y.Y > x.Y )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user