Browse Source

2024-09-21

master
Serg Verevkin 1 year ago
parent
commit
6bfe1e5c89
  1. 51
      202409/ConsoleApp1/Animals/Animal.cs
  2. 2
      202409/ConsoleApp1/Cards/Card.cs
  3. 2
      202409/ConsoleApp1/Cards/CardSuit.cs
  4. 2
      202409/ConsoleApp1/Cards/CardValue.cs
  5. 58
      202409/ConsoleApp1/Program.cs
  6. 61
      scopes.drawio

51
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<MilkConsumer> knownMilkConsumers = new List<MilkConsumer>();
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");
}
}
}

2
202409/ConsoleApp1/Card.cs → 202409/ConsoleApp1/Cards/Card.cs

@ -1,4 +1,4 @@
namespace ConsoleApp1
namespace ConsoleApp1.Cards
{
/// <summary>
/// Класс карты игральной

2
202409/ConsoleApp1/CardSuit.cs → 202409/ConsoleApp1/Cards/CardSuit.cs

@ -1,4 +1,4 @@
namespace ConsoleApp1
namespace ConsoleApp1.Cards
{
/// <summary>
/// Масти карт

2
202409/ConsoleApp1/CardValue.cs → 202409/ConsoleApp1/Cards/CardValue.cs

@ -1,4 +1,4 @@
namespace ConsoleApp1
namespace ConsoleApp1.Cards
{
/// <summary>
/// Масти карт

58
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<int> ll = new List<int>();
h_Lfd(ll);
//h_CountOddAndEven(ll);
}
private static bool h_CountOddAndEven(List<int> ll,
out int iEvenCount, out int iOddCount)
{
throw new NotImplementedException();
}
private static void h_Lfd(List<int> 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();
}
}
}

61
scopes.drawio

@ -0,0 +1,61 @@
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" version="24.7.16">
<diagram name="Страница — 1" id="WaECFrAChVGxal3I7U16">
<mxGraphModel dx="683" dy="378" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="z2H2XQjeVOrq_kiFZw8g-1" value="" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="150" y="120" width="480" height="300" as="geometry" />
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-2" value="Сборка (библиотека, исполняемый модуль)" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="245" y="400" width="290" height="30" as="geometry" />
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-5" value="CInternalClass" style="swimlane;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="250" y="170" width="220" height="140" as="geometry" />
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.25;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="z2H2XQjeVOrq_kiFZw8g-5" source="z2H2XQjeVOrq_kiFZw8g-9" target="z2H2XQjeVOrq_kiFZw8g-5">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="145" y="30" />
<mxPoint x="70" y="30" />
<mxPoint x="70" y="160" />
<mxPoint x="55" y="160" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-9" value="CPrivateClass" style="swimlane;whiteSpace=wrap;html=1;" vertex="1" parent="z2H2XQjeVOrq_kiFZw8g-5">
<mxGeometry x="80" y="50" width="130" height="80" as="geometry" />
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="z2H2XQjeVOrq_kiFZw8g-10">
<mxGeometry relative="1" as="geometry">
<mxPoint x="250" y="260" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-10" value="CPublicClass" style="swimlane;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="90" y="290" width="130" height="80" as="geometry" />
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="z2H2XQjeVOrq_kiFZw8g-11" target="z2H2XQjeVOrq_kiFZw8g-5">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-11" value="CProtectedClass" style="swimlane;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="90" y="190" width="130" height="80" as="geometry" />
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-15" value="sealed" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="510" y="130" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-16" value="private" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
<mxGeometry x="210" y="50" width="90" height="60" as="geometry" />
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-17" value="protected" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="290" y="50" width="90" height="60" as="geometry" />
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-18" value="internal" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
<mxGeometry x="369" y="50" width="90" height="60" as="geometry" />
</mxCell>
<mxCell id="z2H2XQjeVOrq_kiFZw8g-19" value="public" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="450" y="50" width="90" height="60" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Loading…
Cancel
Save