-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOutput.cs
More file actions
64 lines (56 loc) · 1.28 KB
/
Copy pathOutput.cs
File metadata and controls
64 lines (56 loc) · 1.28 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HaikuGen
{
public class Output
{
public List<Word> Words { get; set; }
public Output()
{
Words = new List<IGenerate>();
}
public void Add(Word w)
{
Words.Add(w);
}
public void Clear()
{
Words.Clear();
}
public int Count
{
get { return Words.Count; }
}
public int Syllables
{
get
{
int sylls = 0;
foreach (Word w in Words)
{
sylls += w.Sylls;
}
return sylls;
}
}
public override string ToString()
{
StringBuilder line = new StringBuilder();
line.Append(Words[0].FirstUpper);
for (int i = 1; i < Words.Count; i++)
{
line.Append(" ");
line.Append(Words[i].Text);
}
return line.ToString();
}
public Word this[int i]
{
get { return Words[i]; }
set { Words[i] = value; }
}
}
}