-
Notifications
You must be signed in to change notification settings - Fork 1
/
SourceFileGazePath.cs
37 lines (32 loc) · 977 Bytes
/
SourceFileGazePath.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using NIER2014.Utils;
public class SourceFileGazePath
{
public static void Main(string[] args)
{
if (args.Length == 0)
{
Console.WriteLine("USAGE: Provide a gaze file as the first argument.");
return;
}
GazeResults gaze_results = GazeReader.run(new List<string> { args[0] })[0];
Stack<string> source_filenames = new Stack<string>();
foreach (GazeData gaze_data in gaze_results.gazes)
{
if (source_filenames.Count == 0)
source_filenames.Push(gaze_data.filename);
else
{
if (source_filenames.Peek() != gaze_data.filename)
source_filenames.Push(gaze_data.filename);
}
}
Stack<string> backstack = new Stack<string>();
while (source_filenames.Count > 0)
backstack.Push(source_filenames.Pop());
Console.WriteLine("Results:");
while (backstack.Count > 0)
Console.WriteLine(" - " + backstack.Pop());
}
}