-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
c# Petrol pump - everything but the GUI
- Loading branch information
Showing
6 changed files
with
105 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Custom for Visual Studio | ||
*.cs diff=csharp | ||
*.sln merge=union | ||
*.csproj merge=union | ||
*.vbproj merge=union | ||
*.fsproj merge=union | ||
*.dbproj merge=union | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
c#/Book/PetrolPump/PetrolPump/PetrolPump/Pump/FillState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace PetrolPump.Pump | ||
{ | ||
public class FillState | ||
{ | ||
public enum Type | ||
{ | ||
IDLE, | ||
FILLING, | ||
SALE_COMPLETE | ||
} | ||
|
||
public FillState(Type mode) | ||
{ | ||
this.Mode = mode; | ||
this.Sale = null; | ||
} | ||
|
||
public FillState(Type mode, Sale sale) | ||
{ | ||
this.Mode = mode; | ||
this.Sale = sale; | ||
} | ||
|
||
public readonly Type Mode; | ||
public readonly Sale Sale; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2012 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sodium", "Sodium.csproj", "{D2080704-D359-4743-B568-5D976F9882A0}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "..\Tests\Tests.csproj", "{3BD22EFF-873C-48CF-B8E6-075ACA62F48C}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{3BD22EFF-873C-48CF-B8E6-075ACA62F48C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{3BD22EFF-873C-48CF-B8E6-075ACA62F48C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{3BD22EFF-873C-48CF-B8E6-075ACA62F48C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{3BD22EFF-873C-48CF-B8E6-075ACA62F48C}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{D2080704-D359-4743-B568-5D976F9882A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D2080704-D359-4743-B568-5D976F9882A0}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D2080704-D359-4743-B568-5D976F9882A0}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D2080704-D359-4743-B568-5D976F9882A0}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(MonoDevelopProperties) = preSolution | ||
StartupItem = Sodium.csproj | ||
Policies = $0 | ||
$0.TextStylePolicy = $1 | ||
$1.FileWidth = 120 | ||
$1.TabWidth = 4 | ||
$1.IndentWidth = 2 | ||
$1.inheritsSet = Mono | ||
$1.inheritsScope = text/plain | ||
$1.scope = text/x-csharp | ||
$0.CSharpFormattingPolicy = $2 | ||
$2.ElseIfNewLinePlacement = SameLine | ||
$2.AfterDelegateDeclarationParameterComma = True | ||
$2.inheritsSet = Mono | ||
$2.inheritsScope = text/x-csharp | ||
$2.scope = text/x-csharp | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2012 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sodium", "Sodium.csproj", "{D2080704-D359-4743-B568-5D976F9882A0}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "..\Tests\Tests.csproj", "{3BD22EFF-873C-48CF-B8E6-075ACA62F48C}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{3BD22EFF-873C-48CF-B8E6-075ACA62F48C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{3BD22EFF-873C-48CF-B8E6-075ACA62F48C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{3BD22EFF-873C-48CF-B8E6-075ACA62F48C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{3BD22EFF-873C-48CF-B8E6-075ACA62F48C}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{D2080704-D359-4743-B568-5D976F9882A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D2080704-D359-4743-B568-5D976F9882A0}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D2080704-D359-4743-B568-5D976F9882A0}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D2080704-D359-4743-B568-5D976F9882A0}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(MonoDevelopProperties) = preSolution | ||
StartupItem = Sodium.csproj | ||
Policies = $0 | ||
$0.TextStylePolicy = $1 | ||
$1.FileWidth = 120 | ||
$1.TabWidth = 4 | ||
$1.IndentWidth = 2 | ||
$1.inheritsSet = Mono | ||
$1.inheritsScope = text/plain | ||
$1.scope = text/x-csharp | ||
$0.CSharpFormattingPolicy = $2 | ||
$2.ElseIfNewLinePlacement = SameLine | ||
$2.AfterDelegateDeclarationParameterComma = True | ||
$2.inheritsSet = Mono | ||
$2.inheritsScope = text/x-csharp | ||
$2.scope = text/x-csharp | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters