public IEnumerator LoadPiggyStatsDataUpdate() { update = false; while (update == false) { yield return(null); if (PiggyStatsInfo.IsLoaded() == true) { for (int p = 0; p < GameData.piggyCount; p++) { yield return(true); if (GameData.Piggys[p] != null) { Piggy Piggy = GameData.Piggys[p].GetComponent <Piggy>(); Piggy.cooldown = int.Parse(PiggyStatsInfo.Find_piggy(GameData.piggyCount.ToString()).cooldown); Piggy.value = int.Parse(PiggyStatsInfo.Find_piggy(GameData.piggyCount.ToString()).value); Piggy.speed = int.Parse(PiggyStatsInfo.Find_piggy(GameData.piggyCount.ToString()).speed); Piggy.hungerPerSecond = int.Parse(PiggyStatsInfo.Find_piggy(GameData.piggyCount.ToString()).hungerPerSecond); Piggy.hungerBenchmark = int.Parse(PiggyStatsInfo.Find_piggy(GameData.piggyCount.ToString()).hungerBenchmark); Piggy.hungerFactor = int.Parse(PiggyStatsInfo.Find_piggy(GameData.piggyCount.ToString()).hungerFactor); Piggy.fedBenchmark = int.Parse(PiggyStatsInfo.Find_piggy(GameData.piggyCount.ToString()).fedBenchmark); } } update = true; } } }
public IEnumerator LoadPiggyStatsData(Piggy Piggy) { int i = 0; while (i == 0) { yield return(null); if (PiggyStatsInfo.IsLoaded() == true) { Piggy.hunger = int.Parse(PiggyStatsInfo.Find_piggy(GameData.piggyCount.ToString()).hunger); Piggy.love = int.Parse(PiggyStatsInfo.Find_piggy(GameData.piggyCount.ToString()).love); Piggy.growth = int.Parse(PiggyStatsInfo.Find_piggy(GameData.piggyCount.ToString()).growth); i = 1; } } }
public static void Main(string[] args) { var p = new Piggy(); string ast_file = null; string spec_file = null; bool keep_file = false; bool debug_information = false; string expression = null; string template_directory = null; string output_file = null; CommandLine.Parser.Default.ParseArguments <Options>(args) .WithParsed <Options>(o => { ast_file = o.ClangFile; spec_file = o.PiggyFile; keep_file = o.KeepFile; debug_information = o.DebuggingInformation; expression = o.Expression; output_file = o.OutputFile; template_directory = o.TemplateDirectory; if (spec_file == null && expression == null) { throw new Exception("Either spec file or expression must be set."); } }) .WithNotParsed(a => { System.Console.Error.WriteLine(a); }); Runtime.Tool.CommandLineArgs = args; System.Console.Error.WriteLine("Info: Command line args '" + string.Join("' '", args) + "'"); System.Console.Error.WriteLine("Info: ast_file '" + ast_file + "'"); System.Console.Error.WriteLine("Info: spec_file '" + spec_file + "'"); System.Console.Error.WriteLine("Info: keep_file '" + keep_file + "'"); System.Console.Error.WriteLine("Info: expression '" + expression + "'"); System.Console.Error.WriteLine("Info: output_file '" + output_file + "'"); System.Console.Error.WriteLine("Info: template_directory '" + template_directory + "'"); p.RunTool(ast_file, spec_file, keep_file, expression, template_directory, output_file, debug_information); foreach (var o in Runtime.Tool.GeneratedFiles) { System.Console.Error.WriteLine("Generated: " + o); } }
void DoPigStuff(Piggy p) { label1.Text = String.Format("The pigs tail is {0}", p.TailLength); }