当前位置:网站首页>Unity C basic review 28 - delegation with return (p449)
Unity C basic review 28 - delegation with return (p449)
2022-06-29 15:12:00 【_ A little QQ】
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Master
{
int physical;
public Master(int physical)
{
this.Physical = physical;
}
public int Physical { get => physical; set => physical = value; }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
delegate void AutoTask(Master m);
class Program
{
static void Main(string[] args)
{
Master m = new Master(5);
AutoTask at = Task01;
at += Task02;
at += Task03;
at(m);
}
public static void Task01(Master m)
{
if (m.Physical >= 5)
{
m.Physical -= 5;
}
else
{
return;
}
Console.WriteLine(" Once the task is started !");
Console.WriteLine(" As soon as the task is completed !");
}
public static void Task02(Master m)
{
if (m.Physical >= 5)
{
m.Physical -= 5;
}
else
{
return;
}
Console.WriteLine(" Task 2 starts !");
Console.WriteLine(" Task two complete !");
}
public static void Task03(Master m)
{
if (m.Physical >= 5)
{
m.Physical -= 5;
}
else
{
return;
}
Console.WriteLine(" Task 3 starts !");
Console.WriteLine(" Task three is done !");
}
}

Pass in a parameter m For sharing .
边栏推荐
- What is the relationship between synchronized and multithreading
- MCS:离散随机变量——Binomial分布
- Lumiprobe reactive dye cycloalkyne dye: af488 dbco, 5 isomer
- Configuration tutorial for swagger2
- 携程季报图解:净营收41亿 与疫情前相比已被“腰斩”
- How bad can a programmer be?
- Lumiprobe 活性染料丨氨基染料:花青5胺
- 他山之石 | 丁香园 医疗领域图谱的构建与应用
- Analysis of constant current source circuit composed of two NPN tubes
- 宜明昂科冲刺港股:年内亏损7.3亿 礼来与阳光人寿是股东
猜你喜欢

Lumiprobe reactive dye carboxylic acid: sulfo cyanine7.5 carboxylic acid

Trigonometric function corresponding to drawing circle on plane coordinate

Yi Ming ang Ke rushed to Hong Kong shares: loss of 730million in the year Lilly and sunshine life insurance were shareholders

MCS:多元随机变量——多项式分布

Lumiprobe 活性染料丨羧酸:Sulfo-Cyanine7.5羧酸

mysql 备份与还原

Uniapp problem list and experience

信息学奥赛一本通1194:移动路线

Solution to the problem that the assembly drawing cannot be recognized after the storage position of SolidWorks part drawing is changed

Redis installation in windows and Linux Environment
随机推荐
投资reits基金是靠谱吗,reits基金安全吗
【牛客网刷题系列 之 Verilog快速入门】~ 移位运算与乘法
Yi Ming ang Ke rushed to Hong Kong shares: loss of 730million in the year Lilly and sunshine life insurance were shareholders
Jet hydrogen technology rushes to the scientific innovation board: SAIC Group is the major shareholder to raise 1.06 billion yuan
文本预处理库spaCy的基本使用(快速入门)
信息学奥赛一本通1194:移动路线
卫龙更新招股书:年营收48亿 创始人刘卫平家族色彩浓厚
卫星运动的微分方程
中国软冰淇淋市场预测与投资前景研究报告(2022版)
Informatics Olympiad all in one 1003: aligned output
第九章 APP项目测试(4) 测试工具
Digital IC code -- traffic lights
期货开户可以线下开户吗?在网上开户安全吗?
信息学奥赛一本通1001:Hello,World!
Lumiprobe reactive dye miscellaneous dye: BDP FL ceramide
Implementing redis distributed locks using custom annotations
Research Report on research and development prospect of China's urea dioxide industry (2022 Edition)
中国三氧化二砷行业研究与未来预测报告(2022版)
You need to know about project procurement management
三角函数对应在平面坐标上画圆