tanghai hace 11 años
padre
commit
e19951e7c5

+ 1 - 9
CSharp/App/Modules/BehaviorTreeModule/NodeType.cs

@@ -10,25 +10,17 @@
         SelectTarget = 10000,
         Roll = 10001,
         Compare = 10002,
-        InAttackDistance = 10003,
-        InChaseDistance = 10004,
         FriendDieInDistance = 10005,
-        FriendLessHpInAttackDistance = 10006,
         LessHp = 10007,
-        OnHit = 10008,
-        SelfDie = 10009,
         TargetDie = 100010,
         TargetDistanceLess = 100011,
+        UnitState = 100012,
 
         // action节点 20000开始
         CastSpell = 20000,
         Chase = 20001,
-        Attack = 20002,
         Patrol = 20003,
         Idle = 20004,
-        SummonFriend = 20005,
-        TalkToAll = 20006,
-        CallFriends = 20007,
         CloseTarget = 20008,
         LeaveTarget = 20009,
     }

+ 4 - 4
CSharp/Game/Model/BuffManager.cs

@@ -30,7 +30,7 @@ namespace Model
         {
             foreach (var buff in this.Buffs)
             {
-                this.BuffGuidDict.Add(buff.Id, buff);
+                this.BuffGuidDict.Add(buff.Guid, buff);
             }
 
             foreach (var buff in this.Buffs)
@@ -46,7 +46,7 @@ namespace Model
                 return false;
             }
 
-            if (this.BuffGuidDict.ContainsKey(buff.Id))
+            if (this.BuffGuidDict.ContainsKey(buff.Guid))
             {
                 return false;
             }
@@ -57,7 +57,7 @@ namespace Model
             }
 
             this.Buffs.Add(buff);
-            this.BuffGuidDict.Add(buff.Id, buff);
+            this.BuffGuidDict.Add(buff.Guid, buff);
             this.BuffTypeDict.Add(buff.Type, buff);
 
             return true;
@@ -91,7 +91,7 @@ namespace Model
             }
 
             this.Buffs.Remove(buff);
-            this.BuffGuidDict.Remove(buff.Id);
+            this.BuffGuidDict.Remove(buff.Guid);
             this.BuffTypeDict.Remove(buff.Type);
 
             return true;

+ 4 - 4
CSharp/Game/Model/GameObjectManager.cs

@@ -15,12 +15,12 @@ namespace Model
 
         public void Add(GameObject gameObject)
         {
-            this.gameObjects.Add(gameObject.Id, gameObject);
+            this.gameObjects.Add(gameObject.Guid, gameObject);
             if (!this.typeGameObjects.ContainsKey(gameObject.Type))
             {
                 this.typeGameObjects.Add(gameObject.Type, new Dictionary<ObjectId, GameObject>());
             }
-            this.typeGameObjects[gameObject.Type].Add(gameObject.Id, gameObject);
+            this.typeGameObjects[gameObject.Type].Add(gameObject.Guid, gameObject);
         }
 
         public GameObject Get(ObjectId id)
@@ -46,11 +46,11 @@ namespace Model
             {
                 throw new ArgumentNullException("gameObject");
             }
-            if (!this.gameObjects.Remove(gameObject.Id))
+            if (!this.gameObjects.Remove(gameObject.Guid))
             {
                 return false;
             }
-            if (!this.typeGameObjects[gameObject.Type].Remove(gameObject.Id))
+            if (!this.typeGameObjects[gameObject.Type].Remove(gameObject.Guid))
             {
                 return false;
             }

+ 7 - 0
CSharp/Platform/Common/Base/Component.cs

@@ -0,0 +1,7 @@
+namespace Common.Base
+{
+    public class Component: Object
+    {
+        public Object Parent { get; set; }
+    }
+}

+ 2 - 2
CSharp/Platform/Common/Base/Object.cs

@@ -5,13 +5,13 @@ namespace Common.Base
 {
     public class Object
     {
-        public ObjectId Id { get; set; }
+        public ObjectId Guid { get; set; }
 
         public Dictionary<string, object> Dict { get; private set; }
 
         protected Object()
         {
-            this.Id = ObjectId.GenerateNewId();
+            this.Guid = ObjectId.GenerateNewId();
             this.Dict = new Dictionary<string, object>();
         }
 

+ 1 - 0
CSharp/Platform/Common/Common.csproj

@@ -58,6 +58,7 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Base\Component.cs" />
     <Compile Include="Config\ICategory.cs" />
     <Compile Include="Event\EventTrigger.cs" />
     <Compile Include="Event\Env.cs" />