Ejemplo n.º 1
0
        public void SaveMetadata()
        {
            var lines = File.ReadAllLines(MetadataFile);

            lines[5] = DoRun.ToString();

            File.WriteAllLines(MetadataFile, lines);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Tratar os parâmetros da linha de comando
        /// </summary>
        /// <param name="args"></param>
        public static void Parse(params string[] args)
        {
            List <string> extra;

            try
            {
                extra = Options.Parse(args);

                switch (Operation)
                {
                case TypeOperation.Run:
                    DoRun.Run(SetupPath, out string message);
                    break;

                case TypeOperation.Verify:
                    DoVerify.Verify(SetupPath, out message);
                    break;

                case TypeOperation.Stats:
                    DoStats.Stats(SetupPath, out message);
                    break;

                case TypeOperation.Install:
                    if (string.IsNullOrEmpty(RepositoryHost))
                    {
                        throw new Exception(Strings.Get(StringName.OptionErrorRepository));
                    }
                    if (string.IsNullOrEmpty(ProgramName))
                    {
                        throw new Exception(Strings.Get(StringName.OptionErrorProgram));
                    }
                    DoInstall.Install(SetupPath, RepositoryHost, ProgramName, out message);
                    break;

                case TypeOperation.Update:

                    break;

                case TypeOperation.Setup:
                    // Criar um setup a partir de uma pasta
                    DoCreateSetup.CreateSetup(SetupPath, RepositoryHost, out message);
                    break;

                default:
                    StringWriter m = new StringWriter();
                    Options.WriteOptionDescriptions(m);
                    OperationForm = DoHelp.ShowHelp(m.ToString());
                    break;
                }
            }
            catch (OptionException e)
            {
                Console.WriteLine(Strings.Get(StringName.OptionErrorParameter)
                                  .Replace("%MESSAGE%", e.Message));
                return;
            }
        }
Ejemplo n.º 3
0
 private void InitializeCommands()
 {
     _die       = new DoDie();
     _run       = new DoRun();
     _jump      = new DoJump();
     _crouch    = new DoCrouch();
     _special   = new DoSpecial();
     _moveLeft  = new DoMoveLeft();
     _moveRight = new DoMoveRight();
 }