mirror of
https://github.com/Tribufu/ServerManagers
synced 2026-08-09 12:41:06 +00:00
source code checkin
This commit is contained in:
parent
5f8fb2c825
commit
7e57b72e35
675 changed files with 168433 additions and 0 deletions
48
src/ARKServerManager/Lib/ViewModel/SupplyCrate.cs
Normal file
48
src/ARKServerManager/Lib/ViewModel/SupplyCrate.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace ServerManagerTool.Lib.ViewModel
|
||||
{
|
||||
public class SupplyCrate : DependencyObject
|
||||
{
|
||||
public static readonly DependencyProperty ClassNameProperty = DependencyProperty.Register(nameof(ClassName), typeof(string), typeof(SupplyCrate), new PropertyMetadata(string.Empty));
|
||||
public static readonly DependencyProperty ModProperty = DependencyProperty.Register(nameof(Mod), typeof(string), typeof(SupplyCrate), new PropertyMetadata(String.Empty));
|
||||
public static readonly DependencyProperty KnownSupplyCrateProperty = DependencyProperty.Register(nameof(KnownSupplyCrate), typeof(bool), typeof(SupplyCrate), new PropertyMetadata(false));
|
||||
|
||||
public string ClassName
|
||||
{
|
||||
get { return (string)GetValue(ClassNameProperty); }
|
||||
set { SetValue(ClassNameProperty, value); }
|
||||
}
|
||||
|
||||
public string Mod
|
||||
{
|
||||
get { return (string)GetValue(ModProperty); }
|
||||
set { SetValue(ModProperty, value); }
|
||||
}
|
||||
|
||||
public bool KnownSupplyCrate
|
||||
{
|
||||
get { return (bool)GetValue(KnownSupplyCrateProperty); }
|
||||
set { SetValue(KnownSupplyCrateProperty, value); }
|
||||
}
|
||||
|
||||
public string DisplayName => GameData.FriendlySupplyCrateNameForClass(ClassName);
|
||||
|
||||
public string DisplayMod => GameData.FriendlyNameForClass($"Mod_{Mod}", true) ?? Mod;
|
||||
|
||||
public SupplyCrate Duplicate()
|
||||
{
|
||||
var properties = this.GetType().GetProperties();
|
||||
|
||||
var result = new SupplyCrate();
|
||||
foreach (var prop in properties)
|
||||
{
|
||||
if (prop.CanWrite)
|
||||
prop.SetValue(result, prop.GetValue(this));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue