Exemplo n.º 1
0
 private static void GenerateEntity(Manager manager, FFEntity entity, Compiler compiler,
                                    List <ReificationData> reificationDataList, int nthEntity)
 {
     if (entity.EntityTemplate == null)
     {
         string name     = entity.Name + nthEntity.ToString();
         string path     = Path.Combine(manager.ProjectDir, manager.PrefabsDirName, name + ".cs");
         var    template = new EntityTemplate(entity, nthEntity);
         System.IO.File.WriteAllText(path, template.TransformText());
         reificationDataList.Add(template.ReificationData(entity, name));
         compiler.AddFile(path);
     }
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            try
            {
                //setup the environment
                Manager.Initialize(Path.Combine(Directory.GetCurrentDirectory(), "Content"));
                Manager fileManager = Manager.Instance;
                //AddSantaInResources(fileManager);
                //MK2Path path;
                //path.RelativePath = "Resources/Sprites/Santa.sprite";
                //path.ResourceFolder = "Sprites";
                //path.ResourceName = "Santa";

                Compiler compiler = new Compiler();

                //Generate the Santa.cs in Prefabs
                FFEntity entity = new FFEntity("Klaus");
                entity.Transform.x = 100;
                entity.Transform.y = 100;
                entity.Components.Add(new FFSpriteComponent(entity, "Santa"));
                var FFEntities = new List <FFEntity>();
                FFEntities.Add(entity);

                Codegen.Codegen.CodegenScene(fileManager, FFEntities, compiler);

                //Compile with the demo main : AddFiles should be made automatically.

                AddDependencies(compiler);
                compiler.SetExecutableName("test_codegen");
                compiler.SetExecPath(".");
                compiler.CompileToPortableExec();

                Process.Start("test_codegen.exe");
            }
            //Cleanup in case of error
            catch (System.Exception e)
            {
                throw e;
            }
        }
Exemplo n.º 3
0
 public FFBreakoutBoundaryComponent(FFEntity entity) : base(entity)
 {
     entity.EntityTemplate = "Breakout";
 }
Exemplo n.º 4
0
 public FFBreakoutManagerComponent(FFEntity entity) : base(entity)
 {
     entity.EntityTemplate = "Breakout";
 }