This commit is contained in:
CortexCore
2024-04-06 16:33:32 +08:00
parent 637bbef7d2
commit 37e7fcea51
42 changed files with 597 additions and 149 deletions

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace BITKit
{
public interface IWorldItemObject
{
public IBasicItem Item { get; set; }
public event Action<IBasicItem> OnSetItem;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e0adbb35ce4784342a0ed37ac4a56200
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@@ -36,8 +37,8 @@ namespace BITKit.Modification
/// </summary>
public interface IModifyElement
{
IModifyElement[] Require { get; }
IModifyElement[] Incompatible { get; }
IModifyElement[] Require => Array.Empty<IModifyElement>();
IModifyElement[] Incompatible => Array.Empty<IModifyElement>();
}
/// <summary>
/// 改装管理器

View File

@@ -119,11 +119,16 @@ namespace BITKit
}
public bool TryRemoveProperty<T>()
{
if(properties.TryGetValue(typeof(T).FullName, out var x))
foreach (var pair in properties.Where(x=>x.Value is T))
{
properties.Remove(typeof(T).Name);
properties.Remove(pair.Key);
return true;
}
// if(properties.TryGetValue(typeof(T).FullName, out var x))
// {
// properties.Remove(typeof(T).Name);
// return true;
// }
return false;
}
public bool TrySetProperty<T>(T value)