feat: add combat and deleveling AI
This commit is contained in:
37
Client/Application/Services/EqualityConverter.cs
Normal file
37
Client/Application/Services/EqualityConverter.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Client.Application.Services
|
||||
{
|
||||
public class EqualityConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (values.Length < 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var firstValue = values.First();
|
||||
for (var i = 1; i < values.Length; i++)
|
||||
{
|
||||
if (!firstValue.Equals(values[i]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user