private void Init() { _nodePool = new NodePool(_nodeType); _nodes = new NodeList(); _entities = new Dictionary <Entity, Node>(); _components = new Dictionary <Type, string>(); foreach (var property in _nodeType.GetProperties(BindingFlags.Instance | BindingFlags.Public)) { if (!(property.Name == "Entity" || property.Name == "Previous" || property.Name == "Next")) { _components.Add(property.PropertyType, property.Name); } } }
private void Init() { this.nodePool = new NodePool <TNode>(); this.entities = new Dictionary <Entity, TNode>(); this.components = new Dictionary <Type, string>(); PropertyInfo[] properties = typeof(TNode).GetProperties((global::BindingFlags)5); int i = 0; int num = properties.Length; while (i < num) { PropertyInfo propertyInfo = properties[i]; if (Array.IndexOf <string>(ComponentMatchingFamily <TNode> .reservedProperties, propertyInfo.Name) == -1 && !this.components.ContainsValue(propertyInfo.Name)) { this.components.Add(propertyInfo.PropertyType, propertyInfo.Name); } i++; } }
private void Init() { _nodePool = new NodePool(_nodeType); _nodes = new NodeList(); _entities = new Dictionary<EntityBase, Node>(); _components = new Dictionary<Type, string>(); foreach (var property in _nodeType.GetProperties(BindingFlags.Instance|BindingFlags.Public)) { if (!(property.Name == "Entity" || property.Name == "Previous" || property.Name == "Next")) { _components.Add(property.PropertyType, property.Name); } } }