Ejemplo n.º 1
0
        public NodeList <TNode> GetNodeList <TNode>() where TNode : Node <TNode>, new()
        {
            if (NodeListSingleton <TNode> .NodeList != null)
            {
                return(NodeListSingleton <TNode> .NodeList);
            }
            NodeList <TNode> nodeList = new NodeList <TNode>();

            NodeListSingleton <TNode> .NodeList = nodeList;
            this.nodeLists.Add(nodeList);
            IFamily newFamily = this.familyFactory.GetNewFamily <TNode>();

            FamilySingleton <TNode> .Family = newFamily;
            this.families.Add(newFamily);
            newFamily.Setup(this);
            for (Entity entity = this.entities.Head; entity != null; entity = entity.Next)
            {
                newFamily.NewEntity(entity);
            }
            return(nodeList);
        }
 public void CreateFamily()
 {
     _game   = new Game <ComponentMatchingFamily>();
     _family = new ComponentMatchingFamily();
     _family.Setup(_game, typeof(MockNode));
 }
 public void CreateFamily()
 {
     _game = new Game<ComponentMatchingFamily>();
     _family = new ComponentMatchingFamily();
     _family.Setup(_game, typeof(MockNode));
 }