mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
source code checkin
This commit is contained in:
parent
5f8fb2c825
commit
7e57b72e35
675 changed files with 168433 additions and 0 deletions
46
src/ARKServerManager/Lib/Model/ClassMultiplier.cs
Normal file
46
src/ARKServerManager/Lib/Model/ClassMultiplier.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
using ServerManagerTool.Common.Attibutes;
|
||||
using ServerManagerTool.Common.Model;
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Windows;
|
||||
|
||||
namespace ServerManagerTool.Lib
|
||||
{
|
||||
[DataContract]
|
||||
public class ClassMultiplier : AggregateIniValue
|
||||
{
|
||||
public const float DEFAULT_MULTIPLIER = 1.0f;
|
||||
|
||||
public static readonly DependencyProperty ClassNameProperty = DependencyProperty.Register(nameof(ClassName), typeof(string), typeof(ClassMultiplier), new PropertyMetadata(string.Empty));
|
||||
public static readonly DependencyProperty MultiplierProperty = DependencyProperty.Register(nameof(Multiplier), typeof(float), typeof(ClassMultiplier), new PropertyMetadata(DEFAULT_MULTIPLIER));
|
||||
|
||||
[DataMember]
|
||||
[AggregateIniValueEntry]
|
||||
public string ClassName
|
||||
{
|
||||
get { return (string)GetValue(ClassNameProperty); }
|
||||
set { SetValue(ClassNameProperty, value); }
|
||||
}
|
||||
|
||||
[DataMember]
|
||||
[AggregateIniValueEntry]
|
||||
public float Multiplier
|
||||
{
|
||||
get { return (float)GetValue(MultiplierProperty); }
|
||||
set { SetValue(MultiplierProperty, value); }
|
||||
}
|
||||
|
||||
public virtual string DisplayName => GameData.FriendlyNameForClass(ClassName);
|
||||
|
||||
public static ClassMultiplier FromINIValue(string iniValue)
|
||||
{
|
||||
var newSpawn = new ClassMultiplier();
|
||||
newSpawn.InitializeFromINIValue(iniValue);
|
||||
return newSpawn;
|
||||
}
|
||||
|
||||
public override string GetSortKey() => GameData.FriendlyNameForClass(this.ClassName);
|
||||
|
||||
public override bool IsEquivalent(AggregateIniValue other) => String.Equals(this.ClassName, ((ClassMultiplier)other).ClassName, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue