Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
EntityToIdMap.cs
浏览该文件的文档.
1using System;
2using System.Collections.Generic;
3
4namespace GameEntitySystem {
5 public class EntityToIdMap {
6 Dictionary<Entity, int> m_map;
7
8 internal EntityToIdMap(Dictionary<Entity, int> map) => m_map = map;
9
10 [Obsolete("Use Entity.Id instead.", true)]
11 public int FindId(Entity entity) {
12 if (entity != null
13 && m_map.TryGetValue(entity, out int value)) {
14 return value;
15 }
16 return 0;
17 }
18
19 [Obsolete("Use Component.Entity.Id instead.", true)]
20 public int FindId(Component component) {
21 if (component == null) {
22 return 0;
23 }
24 return FindId(component.Entity);
25 }
26 }
27}
Dictionary< Entity, int > m_map
int FindId(Component component)
EntityToIdMap(Dictionary< Entity, int > map)