1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Threading.Tasks;
6
7 namespace lesson4.entity
8 {
9 /// <summary>
10 /// 蚂蚁类
11 /// </summary>
12 class MY
13 {
14 public MY(string name)
15 {
16 this.Name = name;
17 }
18 /// <summary>
19 /// 蚂蚁名字
20 /// </summary>
21 public string Name{get;set;}
22
23
24 /// <summary>
25 /// 问好
26 /// </summary>
27 public void SayHi()
28 {
29 Console.WriteLine("大家好!我是一只小蚂蚁,名叫"+Name);
30 }
31
32 /// <summary>
33 /// 找甜品
34 /// </summary>
35 public void Find(TP tp)
36 {
37 Console.WriteLine("我找到一块甜品:{0}",tp.Name);
38 }
39
40 /// <summary>
41 /// 招呼伙伴
42 /// </summary>
43 public void Partner(int count)
44 {
45 Console.WriteLine("我招呼到{0}个同伴",count);
46 }
47
48 /// <summary>
49 /// 工作
50 /// </summary>
51 public void Work()
52 {
53 Console.WriteLine("现在,大家搬运甜品");
54 Console.WriteLine("我们完成寻找甜品的任务!");
55 }
56 }
57 }