Example #1
0
        public override IDictionary <Type, Component> copyComponents(EntityRef other)
        {
            IDictionary <Type, Component> result = Maps.newHashMap();

            foreach (Component c in other.iterateComponents())
            {
                result[c.GetType()] = componentLibrary.copy(c);
            }
            return(result);
        }
Example #2
0
        public override EntityRef copy(EntityRef other)
        {
            if (!other.exists())
            {
                return(EntityRef.NULL);
            }
            IList <Component> newEntityComponents = Lists.newArrayList();

            foreach (Component c in other.iterateComponents())
            {
                newEntityComponents.Add(componentLibrary.copy(c));
            }
            return(create(newEntityComponents));
        }