diff --git a/202409/ConsoleApp1/Animals/Animal.cs b/202409/ConsoleApp1/Animals/Animal.cs new file mode 100644 index 0000000..640537c --- /dev/null +++ b/202409/ConsoleApp1/Animals/Animal.cs @@ -0,0 +1,51 @@ +namespace ConsoleApp1.Animals +{ + internal class Animal + { + #region internal classes + internal class MilkConsumerAreaInfo + { + public int Volume { get; set; } + public DateTime MonitoringDate { get; set; } + } + + private class MilkConsumer + { + public int MilkVolume { get; set; } + } + #endregion + + + private List knownMilkConsumers = new List(); + private string _typeName; + + public void MeetMilkConsumer(int Volume) + { + knownMilkConsumers.Add(new MilkConsumer() { MilkVolume = Volume }); + } + public void MeetMilkProduce(int Volume) + { + knownMilkConsumers.Add(new MilkConsumer() { MilkVolume = -Volume }); + } + + internal MilkConsumerAreaInfo GetAreaInfo() + { + return new MilkConsumerAreaInfo(); + } + + protected void SetAnimalTypeName(string sTypeName) + { + _typeName = sTypeName; + } + } + + internal class CatAnimal : Animal + { + public CatAnimal() + { + SetAnimalTypeName("cat"); + } + + + } +} diff --git a/202409/ConsoleApp1/Card.cs b/202409/ConsoleApp1/Cards/Card.cs similarity index 95% rename from 202409/ConsoleApp1/Card.cs rename to 202409/ConsoleApp1/Cards/Card.cs index b67adef..68b13e5 100644 --- a/202409/ConsoleApp1/Card.cs +++ b/202409/ConsoleApp1/Cards/Card.cs @@ -1,4 +1,4 @@ -namespace ConsoleApp1 +namespace ConsoleApp1.Cards { /// /// Класс карты игральной diff --git a/202409/ConsoleApp1/CardSuit.cs b/202409/ConsoleApp1/Cards/CardSuit.cs similarity index 93% rename from 202409/ConsoleApp1/CardSuit.cs rename to 202409/ConsoleApp1/Cards/CardSuit.cs index b7c1a66..e846cb8 100644 --- a/202409/ConsoleApp1/CardSuit.cs +++ b/202409/ConsoleApp1/Cards/CardSuit.cs @@ -1,4 +1,4 @@ -namespace ConsoleApp1 +namespace ConsoleApp1.Cards { /// /// Масти карт diff --git a/202409/ConsoleApp1/CardValue.cs b/202409/ConsoleApp1/Cards/CardValue.cs similarity index 90% rename from 202409/ConsoleApp1/CardValue.cs rename to 202409/ConsoleApp1/Cards/CardValue.cs index b842e56..12235e0 100644 --- a/202409/ConsoleApp1/CardValue.cs +++ b/202409/ConsoleApp1/Cards/CardValue.cs @@ -1,4 +1,4 @@ -namespace ConsoleApp1 +namespace ConsoleApp1.Cards { /// /// Масти карт diff --git a/202409/ConsoleApp1/Program.cs b/202409/ConsoleApp1/Program.cs index fedc587..f9a9ef1 100644 --- a/202409/ConsoleApp1/Program.cs +++ b/202409/ConsoleApp1/Program.cs @@ -1,8 +1,63 @@ -namespace ConsoleApp1 +using ConsoleApp1.Animals; +using ConsoleApp1.Cards; + +namespace ConsoleApp1 { internal class Program { static void Main(string[] args) + { + // h_PlayCards(); + Animal animal = new Animal(); + Animal.MilkConsumerAreaInfo info = animal.GetAreaInfo(); + h_Afd(); + Console.ReadKey(); + } + + private static void h_Afd() + { + int ii = 0; + Console.WriteLine(ii); + h_Afd1(ii); + Console.WriteLine(ii); + h_Afd2(ref ii); + Console.WriteLine(ii); + h_Afd3(out ii); + Console.WriteLine(ii); + + List ll = new List(); + h_Lfd(ll); + + //h_CountOddAndEven(ll); + } + + private static bool h_CountOddAndEven(List ll, + out int iEvenCount, out int iOddCount) + { + throw new NotImplementedException(); + } + + private static void h_Lfd(List ll) + { + ll.Add(1); + ll.Add(2); + + } + + private static void h_Afd1(int ii) + { + ii++; + } + private static void h_Afd2(ref int ii) + { + ii++; + } + private static void h_Afd3(out int ii) + { + ii = 10; + } + + private static void h_PlayCards() { CardSuit myCardType = CardSuit.Черви; Console.WriteLine($"{myCardType}"); @@ -26,7 +81,6 @@ { Console.WriteLine($"{card.Suit}:{card.Value}"); } - Console.ReadKey(); } } } \ No newline at end of file diff --git a/scopes.drawio b/scopes.drawio new file mode 100644 index 0000000..8a9de26 --- /dev/null +++ b/scopes.drawio @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +