コード例 #1
0
        private static void addComponentsAttributes(EntityInfo entityInfo)
        {
            RepeatedAttributesController repeatedAttributesController = new RepeatedAttributesController();

            foreach (Dictionary <string, object> componentAttributes in entityInfo.getComponentsInfo)
            {
                foreach (KeyValuePair <string, object> attribute in componentAttributes)
                {
                    if (!repeatedAttributesController.isRepeated(attribute.Key))
                    {
                        entity += "\n\t" + attribute.Key + " = " + TranslatorsDictionary.getTranslatorOf(attribute.Value.GetType()).translate(attribute.Value) + ",";
                    }
                    else
                    {
                        resolveConflicts(attribute);
                        Debug.Log("Atributo " + attribute.Key + " esta repetido en el game object " + entityInfo.getName);
                    }
                }
            }
        }
コード例 #2
0
 private static string translateAttribute(object attribute)
 {
     return(TranslatorsDictionary.getTranslatorOf(attribute.GetType()).translate(attribute));
 }