提交 6dd31f36 编写于 作者: T tanghai

id改成guid

上级 ad42eb45
using Common.Base;
using MongoDB.Bson.Serialization.Attributes;
namespace Model
{
......
......@@ -2,14 +2,12 @@
using System.ComponentModel;
using Common.Base;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using Component = Common.Base.Component;
namespace Model
{
public class BuffComponent: Component, ISupportInitialize
{
[BsonElement]
public HashSet<Buff> Buffs { get; set; }
private Dictionary<ObjectId, Buff> buffGuidDict { get; set; }
......@@ -32,10 +30,6 @@ namespace Model
foreach (var buff in this.Buffs)
{
this.buffGuidDict.Add(buff.Guid, buff);
}
foreach (var buff in this.Buffs)
{
this.buffTypeMMap.Add(buff.Type, buff);
}
}
......
......@@ -23,10 +23,10 @@ namespace Model
this.typeGameObjects[gameObject.Type].Add(gameObject.Guid, gameObject);
}
public GameObject Get(ObjectId id)
public GameObject Get(ObjectId guid)
{
GameObject gameObject = null;
this.gameObjects.TryGetValue(id, out gameObject);
this.gameObjects.TryGetValue(guid, out gameObject);
return gameObject;
}
......@@ -57,9 +57,9 @@ namespace Model
return true;
}
public bool Remove(ObjectId id)
public bool Remove(ObjectId guid)
{
GameObject gameObject = this.Get(id);
GameObject gameObject = this.Get(guid);
if (gameObject == null)
{
return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册