Ai
1 Star 1 Fork 0

稻草堆上打着滚儿/DesignMode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
BasicEdition.cs 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
sayook@qq.com 提交于 2020-04-26 15:17 +08:00 . 状态模式
using System;
namespace State.BasicEdition
{
/// <summary>
/// 生活
/// </summary>
public class Life
{
/// <summary>
/// 时间段
/// </summary>
public Time Time { get; set; }
/// <summary>
/// 天气
/// </summary>
public Weather Weather { get; set; }
/// <summary>
/// 干啥子
/// </summary>
public void Doing()
{
if (Time == Time.Morning)
{
Console.WriteLine($"\n现在是 早上,春香 服侍我起床~");
}
else if (Time == Time.Noon)
{
Console.WriteLine($"\n现在是 中午,夏香 陪我玩耍~");
if (Weather == Weather.Good)
{
Console.WriteLine($"天气真好,陪我出去放风筝");
}
else
{
Console.WriteLine($"天气不好,待家给我跳舞");
}
}
else if (Time == Time.Afternoon)
{
Console.WriteLine($"\n现在是 下午,秋香 服侍我用餐~");
}
else if (Time == Time.Night)
{
Console.WriteLine($"\n现在是 晚上,冬香 服侍我就寝~");
}
else
{
Console.WriteLine($"\n睡觉中...");
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/sayook/DesignMode.git
git@gitee.com:sayook/DesignMode.git
sayook
DesignMode
DesignMode
master

搜索帮助