Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老鱼er
et
提交
f54e3ed7
E
et
项目概览
老鱼er
/
et
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
et
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f54e3ed7
编写于
10月 31, 2014
作者:
T
tanghai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
EventComponent类搭配不同的attribute可以用来分发,例如可以分发:消息,buff效果,技能效果,事件等
上级
6ae99007
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
19 addition
and
20 deletion
+19
-20
CSharp/Game/Controller/BuffComponentExtension.cs
CSharp/Game/Controller/BuffComponentExtension.cs
+4
-4
CSharp/Game/Controller/Controller.csproj
CSharp/Game/Controller/Controller.csproj
+1
-1
CSharp/Game/Controller/EventType.cs
CSharp/Game/Controller/EventType.cs
+1
-1
CSharp/Game/Model/EventAttribute.cs
CSharp/Game/Model/EventAttribute.cs
+11
-0
CSharp/Game/Model/Model.csproj
CSharp/Game/Model/Model.csproj
+1
-2
CSharp/Game/Model/WorldEventAttribute.cs
CSharp/Game/Model/WorldEventAttribute.cs
+0
-11
CSharp/Game/MongoDBTest/MongoDBTest.cs
CSharp/Game/MongoDBTest/MongoDBTest.cs
+1
-1
未找到文件。
CSharp/Game/Controller/BuffComponentExtension.cs
浏览文件 @
f54e3ed7
...
@@ -27,13 +27,13 @@ namespace Controller
...
@@ -27,13 +27,13 @@ namespace Controller
env
[
EnvKey
.
Unit
]
=
buffComponent
.
Owner
;
env
[
EnvKey
.
Unit
]
=
buffComponent
.
Owner
;
env
[
EnvKey
.
Buff
]
=
buff
;
env
[
EnvKey
.
Buff
]
=
buff
;
World
.
Instance
.
GetComponent
<
EventComponent
<
WorldEventAttribute
>>().
Trigger
(
World
EventType
.
BeforeAddBuff
,
env
);
World
.
Instance
.
GetComponent
<
EventComponent
<
EventAttribute
>>().
Trigger
(
EventType
.
BeforeAddBuff
,
env
);
buffComponent
.
buffs
.
Add
(
buff
);
buffComponent
.
buffs
.
Add
(
buff
);
buffComponent
.
idBuff
.
Add
(
buff
.
Id
,
buff
);
buffComponent
.
idBuff
.
Add
(
buff
.
Id
,
buff
);
buffComponent
.
typeBuff
.
Add
(
buff
.
Config
.
Type
,
buff
);
buffComponent
.
typeBuff
.
Add
(
buff
.
Config
.
Type
,
buff
);
World
.
Instance
.
GetComponent
<
EventComponent
<
WorldEventAttribute
>>().
Trigger
(
World
EventType
.
AfterAddBuff
,
env
);
World
.
Instance
.
GetComponent
<
EventComponent
<
EventAttribute
>>().
Trigger
(
EventType
.
AfterAddBuff
,
env
);
}
}
public
static
Buff
GetById
(
this
BuffComponent
buffComponent
,
ObjectId
id
)
public
static
Buff
GetById
(
this
BuffComponent
buffComponent
,
ObjectId
id
)
...
@@ -67,13 +67,13 @@ namespace Controller
...
@@ -67,13 +67,13 @@ namespace Controller
env
[
EnvKey
.
Unit
]
=
buffComponent
.
Owner
;
env
[
EnvKey
.
Unit
]
=
buffComponent
.
Owner
;
env
[
EnvKey
.
Buff
]
=
buff
;
env
[
EnvKey
.
Buff
]
=
buff
;
World
.
Instance
.
GetComponent
<
EventComponent
<
UnitEventAttribute
>>().
Trigger
(
World
EventType
.
BeforeRemoveBuff
,
env
);
World
.
Instance
.
GetComponent
<
EventComponent
<
EventAttribute
>>().
Trigger
(
EventType
.
BeforeRemoveBuff
,
env
);
buffComponent
.
buffs
.
Remove
(
buff
);
buffComponent
.
buffs
.
Remove
(
buff
);
buffComponent
.
idBuff
.
Remove
(
buff
.
Id
);
buffComponent
.
idBuff
.
Remove
(
buff
.
Id
);
buffComponent
.
typeBuff
.
Remove
(
buff
.
Config
.
Type
,
buff
);
buffComponent
.
typeBuff
.
Remove
(
buff
.
Config
.
Type
,
buff
);
World
.
Instance
.
GetComponent
<
EventComponent
<
UnitEventAttribute
>>().
Trigger
(
World
EventType
.
AfterRemoveBuff
,
env
);
World
.
Instance
.
GetComponent
<
EventComponent
<
EventAttribute
>>().
Trigger
(
EventType
.
AfterRemoveBuff
,
env
);
return
true
;
return
true
;
}
}
...
...
CSharp/Game/Controller/Controller.csproj
浏览文件 @
f54e3ed7
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
<Compile
Include=
"ConfigCategory\UnitCategory.cs"
/>
<Compile
Include=
"ConfigCategory\UnitCategory.cs"
/>
<Compile
Include=
"NodeType.cs"
/>
<Compile
Include=
"NodeType.cs"
/>
<Compile
Include=
"Factory\UnitFactory.cs"
/>
<Compile
Include=
"Factory\UnitFactory.cs"
/>
<Compile
Include=
"
World
EventType.cs"
/>
<Compile
Include=
"EventType.cs"
/>
<Compile
Include=
"UnitType.cs"
/>
<Compile
Include=
"UnitType.cs"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
CSharp/Game/Controller/
World
EventType.cs
→
CSharp/Game/Controller/EventType.cs
浏览文件 @
f54e3ed7
namespace
Controller
namespace
Controller
{
{
public
static
class
World
EventType
public
static
class
EventType
{
{
public
const
int
BeforeAddBuff
=
0
;
public
const
int
BeforeAddBuff
=
0
;
public
const
int
AfterAddBuff
=
1
;
public
const
int
AfterAddBuff
=
1
;
...
...
CSharp/Game/Model/
Unit
EventAttribute.cs
→
CSharp/Game/Model/EventAttribute.cs
浏览文件 @
f54e3ed7
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
namespace
Model
namespace
Model
{
{
public
class
Unit
EventAttribute
:
AEventAttribute
public
class
EventAttribute
:
AEventAttribute
{
{
public
Unit
EventAttribute
(
int
type
):
base
(
type
)
public
EventAttribute
(
int
type
):
base
(
type
)
{
{
}
}
}
}
...
...
CSharp/Game/Model/Model.csproj
浏览文件 @
f54e3ed7
...
@@ -67,8 +67,7 @@
...
@@ -67,8 +67,7 @@
<Compile
Include=
"Config\NodeConfig.cs"
/>
<Compile
Include=
"Config\NodeConfig.cs"
/>
<Compile
Include=
"Unit.cs"
/>
<Compile
Include=
"Unit.cs"
/>
<Compile
Include=
"World.cs"
/>
<Compile
Include=
"World.cs"
/>
<Compile
Include=
"UnitEventAttribute.cs"
/>
<Compile
Include=
"EventAttribute.cs"
/>
<Compile
Include=
"WorldEventAttribute.cs"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Folder
Include=
"Properties\"
/>
<Folder
Include=
"Properties\"
/>
...
...
CSharp/Game/Model/WorldEventAttribute.cs
已删除
100644 → 0
浏览文件 @
6ae99007
using
Common.Event
;
namespace
Model
{
public
class
WorldEventAttribute
:
AEventAttribute
{
public
WorldEventAttribute
(
int
type
):
base
(
type
)
{
}
}
}
CSharp/Game/MongoDBTest/MongoDBTest.cs
浏览文件 @
f54e3ed7
...
@@ -24,7 +24,7 @@ namespace MongoDBTest
...
@@ -24,7 +24,7 @@ namespace MongoDBTest
// 加载配置
// 加载配置
world
.
AddComponent
<
ConfigComponent
>();
world
.
AddComponent
<
ConfigComponent
>();
world
.
AddComponent
<
EventComponent
<
World
EventAttribute
>>();
world
.
AddComponent
<
EventComponent
<
EventAttribute
>>();
world
.
AddComponent
<
UnitComponent
>();
world
.
AddComponent
<
UnitComponent
>();
world
.
AddComponent
<
FactoryComponent
<
Unit
>>();
world
.
AddComponent
<
FactoryComponent
<
Unit
>>();
world
.
AddComponent
<
BehaviorTreeComponent
>();
world
.
AddComponent
<
BehaviorTreeComponent
>();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录