├── .gitattributes
├── .gitignore
├── Başlıksız Diyagram.drawio
├── GameProject.sln
└── GameProject
├── Abstract
├── ICampaignService.cs
└── IPlayer.cs
├── Concrete
├── GameManager.cs
└── PlayerManager.cs
├── Entities
├── BlackFridayCampaign.cs
├── Game.cs
├── NewPlayer.cs
├── OldPlayer.cs
└── StudentCampaign.cs
├── GameProject.csproj
└── Program.cs
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | [Aa][Rr][Mm]/
24 | [Aa][Rr][Mm]64/
25 | bld/
26 | [Bb]in/
27 | [Oo]bj/
28 | [Ll]og/
29 |
30 | # Visual Studio 2015/2017 cache/options directory
31 | .vs/
32 | # Uncomment if you have tasks that create the project's static files in wwwroot
33 | #wwwroot/
34 |
35 | # Visual Studio 2017 auto generated files
36 | Generated\ Files/
37 |
38 | # MSTest test Results
39 | [Tt]est[Rr]esult*/
40 | [Bb]uild[Ll]og.*
41 |
42 | # NUNIT
43 | *.VisualState.xml
44 | TestResult.xml
45 |
46 | # Build Results of an ATL Project
47 | [Dd]ebugPS/
48 | [Rr]eleasePS/
49 | dlldata.c
50 |
51 | # Benchmark Results
52 | BenchmarkDotNet.Artifacts/
53 |
54 | # .NET Core
55 | project.lock.json
56 | project.fragment.lock.json
57 | artifacts/
58 |
59 | # StyleCop
60 | StyleCopReport.xml
61 |
62 | # Files built by Visual Studio
63 | *_i.c
64 | *_p.c
65 | *_h.h
66 | *.ilk
67 | *.meta
68 | *.obj
69 | *.iobj
70 | *.pch
71 | *.pdb
72 | *.ipdb
73 | *.pgc
74 | *.pgd
75 | *.rsp
76 | *.sbr
77 | *.tlb
78 | *.tli
79 | *.tlh
80 | *.tmp
81 | *.tmp_proj
82 | *_wpftmp.csproj
83 | *.log
84 | *.vspscc
85 | *.vssscc
86 | .builds
87 | *.pidb
88 | *.svclog
89 | *.scc
90 |
91 | # Chutzpah Test files
92 | _Chutzpah*
93 |
94 | # Visual C++ cache files
95 | ipch/
96 | *.aps
97 | *.ncb
98 | *.opendb
99 | *.opensdf
100 | *.sdf
101 | *.cachefile
102 | *.VC.db
103 | *.VC.VC.opendb
104 |
105 | # Visual Studio profiler
106 | *.psess
107 | *.vsp
108 | *.vspx
109 | *.sap
110 |
111 | # Visual Studio Trace Files
112 | *.e2e
113 |
114 | # TFS 2012 Local Workspace
115 | $tf/
116 |
117 | # Guidance Automation Toolkit
118 | *.gpState
119 |
120 | # ReSharper is a .NET coding add-in
121 | _ReSharper*/
122 | *.[Rr]e[Ss]harper
123 | *.DotSettings.user
124 |
125 | # JustCode is a .NET coding add-in
126 | .JustCode
127 |
128 | # TeamCity is a build add-in
129 | _TeamCity*
130 |
131 | # DotCover is a Code Coverage Tool
132 | *.dotCover
133 |
134 | # AxoCover is a Code Coverage Tool
135 | .axoCover/*
136 | !.axoCover/settings.json
137 |
138 | # Visual Studio code coverage results
139 | *.coverage
140 | *.coveragexml
141 |
142 | # NCrunch
143 | _NCrunch_*
144 | .*crunch*.local.xml
145 | nCrunchTemp_*
146 |
147 | # MightyMoose
148 | *.mm.*
149 | AutoTest.Net/
150 |
151 | # Web workbench (sass)
152 | .sass-cache/
153 |
154 | # Installshield output folder
155 | [Ee]xpress/
156 |
157 | # DocProject is a documentation generator add-in
158 | DocProject/buildhelp/
159 | DocProject/Help/*.HxT
160 | DocProject/Help/*.HxC
161 | DocProject/Help/*.hhc
162 | DocProject/Help/*.hhk
163 | DocProject/Help/*.hhp
164 | DocProject/Help/Html2
165 | DocProject/Help/html
166 |
167 | # Click-Once directory
168 | publish/
169 |
170 | # Publish Web Output
171 | *.[Pp]ublish.xml
172 | *.azurePubxml
173 | # Note: Comment the next line if you want to checkin your web deploy settings,
174 | # but database connection strings (with potential passwords) will be unencrypted
175 | *.pubxml
176 | *.publishproj
177 |
178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
179 | # checkin your Azure Web App publish settings, but sensitive information contained
180 | # in these scripts will be unencrypted
181 | PublishScripts/
182 |
183 | # NuGet Packages
184 | *.nupkg
185 | # The packages folder can be ignored because of Package Restore
186 | **/[Pp]ackages/*
187 | # except build/, which is used as an MSBuild target.
188 | !**/[Pp]ackages/build/
189 | # Uncomment if necessary however generally it will be regenerated when needed
190 | #!**/[Pp]ackages/repositories.config
191 | # NuGet v3's project.json files produces more ignorable files
192 | *.nuget.props
193 | *.nuget.targets
194 |
195 | # Microsoft Azure Build Output
196 | csx/
197 | *.build.csdef
198 |
199 | # Microsoft Azure Emulator
200 | ecf/
201 | rcf/
202 |
203 | # Windows Store app package directories and files
204 | AppPackages/
205 | BundleArtifacts/
206 | Package.StoreAssociation.xml
207 | _pkginfo.txt
208 | *.appx
209 |
210 | # Visual Studio cache files
211 | # files ending in .cache can be ignored
212 | *.[Cc]ache
213 | # but keep track of directories ending in .cache
214 | !?*.[Cc]ache/
215 |
216 | # Others
217 | ClientBin/
218 | ~$*
219 | *~
220 | *.dbmdl
221 | *.dbproj.schemaview
222 | *.jfm
223 | *.pfx
224 | *.publishsettings
225 | orleans.codegen.cs
226 |
227 | # Including strong name files can present a security risk
228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
229 | #*.snk
230 |
231 | # Since there are multiple workflows, uncomment next line to ignore bower_components
232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
233 | #bower_components/
234 |
235 | # RIA/Silverlight projects
236 | Generated_Code/
237 |
238 | # Backup & report files from converting an old project file
239 | # to a newer Visual Studio version. Backup files are not needed,
240 | # because we have git ;-)
241 | _UpgradeReport_Files/
242 | Backup*/
243 | UpgradeLog*.XML
244 | UpgradeLog*.htm
245 | ServiceFabricBackup/
246 | *.rptproj.bak
247 |
248 | # SQL Server files
249 | *.mdf
250 | *.ldf
251 | *.ndf
252 |
253 | # Business Intelligence projects
254 | *.rdl.data
255 | *.bim.layout
256 | *.bim_*.settings
257 | *.rptproj.rsuser
258 | *- Backup*.rdl
259 |
260 | # Microsoft Fakes
261 | FakesAssemblies/
262 |
263 | # GhostDoc plugin setting file
264 | *.GhostDoc.xml
265 |
266 | # Node.js Tools for Visual Studio
267 | .ntvs_analysis.dat
268 | node_modules/
269 |
270 | # Visual Studio 6 build log
271 | *.plg
272 |
273 | # Visual Studio 6 workspace options file
274 | *.opt
275 |
276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
277 | *.vbw
278 |
279 | # Visual Studio LightSwitch build output
280 | **/*.HTMLClient/GeneratedArtifacts
281 | **/*.DesktopClient/GeneratedArtifacts
282 | **/*.DesktopClient/ModelManifest.xml
283 | **/*.Server/GeneratedArtifacts
284 | **/*.Server/ModelManifest.xml
285 | _Pvt_Extensions
286 |
287 | # Paket dependency manager
288 | .paket/paket.exe
289 | paket-files/
290 |
291 | # FAKE - F# Make
292 | .fake/
293 |
294 | # JetBrains Rider
295 | .idea/
296 | *.sln.iml
297 |
298 | # CodeRush personal settings
299 | .cr/personal
300 |
301 | # Python Tools for Visual Studio (PTVS)
302 | __pycache__/
303 | *.pyc
304 |
305 | # Cake - Uncomment if you are using it
306 | # tools/**
307 | # !tools/packages.config
308 |
309 | # Tabs Studio
310 | *.tss
311 |
312 | # Telerik's JustMock configuration file
313 | *.jmconfig
314 |
315 | # BizTalk build output
316 | *.btp.cs
317 | *.btm.cs
318 | *.odx.cs
319 | *.xsd.cs
320 |
321 | # OpenCover UI analysis results
322 | OpenCover/
323 |
324 | # Azure Stream Analytics local run output
325 | ASALocalRun/
326 |
327 | # MSBuild Binary and Structured Log
328 | *.binlog
329 |
330 | # NVidia Nsight GPU debugger configuration file
331 | *.nvuser
332 |
333 | # MFractors (Xamarin productivity tool) working folder
334 | .mfractor/
335 |
336 | # Local History for Visual Studio
337 | .localhistory/
338 |
339 | # BeatPulse healthcheck temp database
340 | healthchecksdb
--------------------------------------------------------------------------------
/Başlıksız Diyagram.drawio:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
--------------------------------------------------------------------------------
/GameProject.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30907.101
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameProject", "GameProject\GameProject.csproj", "{FE55045A-57E9-401A-80C4-525E9285C78F}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {FE55045A-57E9-401A-80C4-525E9285C78F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {FE55045A-57E9-401A-80C4-525E9285C78F}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {FE55045A-57E9-401A-80C4-525E9285C78F}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {FE55045A-57E9-401A-80C4-525E9285C78F}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {704AEE63-DA40-4FF8-8781-0C26B42CB225}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/GameProject/Abstract/ICampaignService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace GameProject
6 | {
7 | interface ICampaignService
8 | {
9 | void CalculateSale(Game game);
10 | void SaleInformation(Game game);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/GameProject/Abstract/IPlayer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace GameProject.Interface
6 | {
7 | public interface IPlayer
8 | {
9 | public string PlayerName { get; set; }
10 | public string PlayerSurname { get; set; }
11 | public string TcNo { get; set; }
12 | public int BirthYear { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/GameProject/Concrete/GameManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace GameProject
6 | {
7 | class GameManager
8 | {
9 | List games = new List() { };
10 |
11 | public void Add(Game game)
12 | {
13 | games.Add(game);
14 | Console.WriteLine("{0} isimli oyun eklendi.",game.GameName);
15 | }
16 |
17 | public void Update(Game game)
18 | {
19 |
20 | }
21 |
22 | public void Delete(string GameName)
23 | {
24 | foreach (var game in games)
25 | {
26 | if (game.GameName == GameName)
27 | {
28 | games.Remove(game);
29 | Console.WriteLine("{0} , isimli oyun sistemden silindi.", game.GameName);
30 | break;
31 | }
32 |
33 | else
34 | {
35 | continue;
36 | }
37 | }
38 |
39 | }
40 |
41 | public void ListGame()
42 | {
43 | int i = 1;
44 | foreach (var game in games)
45 | {
46 | Console.WriteLine("--------------------------");
47 | Console.WriteLine("{0}.Oyun\nOyun Adı:{1}\nÇıkış Yılı:{2}\nOyunun Türü:{3}\nOyunun Fiyatı:{4}\nOyunun İnceleme Puanı:{5}", i,game.GameName,game.GameReleaseYear,game.GameType,game.GamePrice,game.GameReviewScore);
48 | Console.WriteLine("--------------------------");
49 | i += 1;
50 | }
51 | }
52 |
53 | public void GetGame(string GameName,ICampaignService campaign)
54 | {
55 | foreach (var game in games)
56 | {
57 | if (game.GameName == GameName)
58 | {
59 | campaign.CalculateSale(game);
60 | campaign.SaleInformation(game);
61 | }
62 |
63 | else
64 | {
65 | continue;
66 | }
67 | }
68 | }
69 |
70 | public void SortByReviewScores()
71 | {
72 | List temp = new List() { };
73 | temp.Add(new Game(){});
74 |
75 | for (int i = 0; i < games.Count; i++)
76 | {
77 | for (int j = i; j < games.Count; j++)
78 | {
79 | if (games[i].GameReviewScore temp2 = new List() { };
105 | temp2.Add(new Game() { });
106 |
107 | for (int i = 0; i < games.Count; i++)
108 | {
109 | for (int j = i; j < games.Count; j++)
110 | {
111 | if (games[i].GameReleaseYear < games[j].GameReleaseYear)
112 | {
113 | temp2[0] = games[i];
114 | games[i] = games[j];
115 | games[j] = temp2[0];
116 | }
117 | else
118 | {
119 | continue;
120 | }
121 | }
122 | }
123 |
124 | Console.WriteLine("---------------------");
125 | int b = 1;
126 | foreach (var game1 in games)
127 | {
128 | Console.WriteLine($"{b}.{game1.GameName.PadRight(20, ' ')}({game1.GameReleaseYear})");
129 | b += 1;
130 | }
131 | Console.WriteLine("---------------------");
132 | }
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/GameProject/Concrete/PlayerManager.cs:
--------------------------------------------------------------------------------
1 | using GameProject.Interface;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace GameProject
7 | {
8 | class PlayerManager
9 | {
10 | List players = new List() { };
11 | public void Add(IPlayer player)
12 | {
13 | players.Add(player);
14 | Console.WriteLine("{0} {1}, isimli oyuncu sisteme eklendi.",player.PlayerName,player.PlayerSurname);
15 | }
16 |
17 | public void Update(IPlayer player,int Id)
18 | {
19 |
20 | }
21 |
22 | public void Delete(string TcNo)
23 | {
24 | foreach (var player in players)
25 | {
26 | if (player.TcNo==TcNo)
27 | {
28 | players.Remove(player);
29 | Console.WriteLine("{0} {1}, isimli oyuncu sistemden silindi.", player.PlayerName, player.PlayerSurname);
30 | break;
31 | }
32 |
33 | else
34 | {
35 | continue;
36 | }
37 | }
38 |
39 | }
40 |
41 | public void ListPlayer()
42 | {
43 | int i = 1;
44 | foreach (var player in players)
45 | {
46 | Console.WriteLine("--------------------------");
47 | Console.WriteLine("{0}.Oyuncu\nAd Soyad:{1} {2}\nTc No:{3}\nDoğum Yılı:{4}",i,player.PlayerName,player.PlayerSurname,player.TcNo,player.BirthYear);
48 | Console.WriteLine("--------------------------");
49 | i += 1;
50 | }
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/GameProject/Entities/BlackFridayCampaign.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace GameProject
6 | {
7 | class BlackFridayCampaign : ICampaignService
8 | {
9 | public void CalculateSale(Game game)
10 | {
11 | game.GamePrice -= game.GamePrice * (0.15);
12 | }
13 |
14 | public void SaleInformation(Game game)
15 | {
16 | Console.WriteLine("{0} isimli oyuna kara cuma kampanyası uygulandı.\nYeni Fiyat:{1} TL\n", game.GameName, game.GamePrice);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/GameProject/Entities/Game.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace GameProject
6 | {
7 | class Game
8 | {
9 | public string GameName { get; set; }
10 | public int GameReleaseYear { get; set; }
11 | public string GameType { get; set; }
12 | public double GameReviewScore { get; set; }
13 | public double GamePrice { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/GameProject/Entities/NewPlayer.cs:
--------------------------------------------------------------------------------
1 | using GameProject.Interface;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace GameProject
7 | {
8 | public class NewPlayer: IPlayer
9 | {
10 | public int UndertakingYear { get; set; }
11 | public string PlayerName { get; set; }
12 | public string PlayerSurname { get; set; }
13 | public string TcNo { get; set; }
14 | public int BirthYear { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/GameProject/Entities/OldPlayer.cs:
--------------------------------------------------------------------------------
1 | using GameProject.Interface;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace GameProject
7 | {
8 | public class OldPlayer : IPlayer
9 | {
10 | public int MembershipYear { get; set; }
11 | public string PlayerName { get; set; }
12 | public string PlayerSurname { get; set; }
13 | public string TcNo { get; set; }
14 | public int BirthYear { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/GameProject/Entities/StudentCampaign.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace GameProject
6 | {
7 | class StudentCampaign : ICampaignService
8 | {
9 | public void CalculateSale(Game game)
10 | {
11 | game.GamePrice -= game.GamePrice * (0.2);
12 | }
13 |
14 | public void SaleInformation(Game game)
15 | {
16 | Console.WriteLine("{0} isimli oyuna öğrenci kampanyası uygulandı.\nYeni Fiyat:{1} TL\n",game.GameName,game.GamePrice);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/GameProject/GameProject.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp3.1
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/GameProject/Program.cs:
--------------------------------------------------------------------------------
1 | using GameProject.Interface;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace GameProject
6 | {
7 | class Program
8 | {
9 | static void Main(string[] args)
10 | {
11 | IPlayer player1 = new OldPlayer() { TcNo = "1", BirthYear = 1999, PlayerName = "Anday", PlayerSurname = "Aktaş", MembershipYear = 2 };
12 | IPlayer player2 = new OldPlayer() { TcNo = "2", BirthYear = 1985, PlayerName = "Engin", PlayerSurname = "Demiroğ", MembershipYear = 20 };
13 | PlayerManager playerManager = new PlayerManager();
14 | playerManager.Add(player1);
15 | playerManager.Add(player2);
16 |
17 | GameManager gameManager = new GameManager();
18 | gameManager.Add(new Game() { GameName = "Death Stranding", GameType = "Action", GamePrice = 499, GameReleaseYear = 2018, GameReviewScore = 8.3 });
19 | gameManager.Add(new Game() { GameName = "Days Gone", GameType = "Action,Zombie", GamePrice = 139, GameReleaseYear = 2018, GameReviewScore = 7.3 });
20 | gameManager.Add(new Game() { GameName = "Persona 5", GameType = "JRPG", GamePrice = 99, GameReleaseYear = 2015, GameReviewScore = 9.1 });
21 | gameManager.Add(new Game() { GameName = "Cyberpunk 2077", GameType = "RPG", GamePrice = 499, GameReleaseYear = 2020, GameReviewScore = 7.1 });
22 | gameManager.Add(new Game() { GameName = "Witcher 3", GameType = "RPG", GamePrice = 59, GameReleaseYear = 2015, GameReviewScore = 9.3 });
23 |
24 | while (true)
25 | {
26 | Console.WriteLine("**********MENU**********");
27 | Console.WriteLine("1-)Oyuncu Ekle\n2-)Oyuncu Sil\n3-)Kullanıcıları Listele\n4-)Oyun Ekle\n5-)Oyun Sil\n6-)Oyunları Listele\n7-)Oyunları İnceleme Puanına Göre Listele\n8-)Oyunları Çıkış Yıllarına Göre Sırala\n9-)Kampanya Seçiniz\n10-)Çıkış");
28 | Console.WriteLine("************************");
29 | int choice = Convert.ToInt32(Console.ReadLine());
30 | Console.Clear();
31 | if (choice==1 || choice == 2 || choice == 3 || choice == 4 || choice == 5 || choice == 6 || choice == 7 || choice == 8 || choice == 9)
32 | {
33 | switch (choice)
34 | {
35 | case 1:
36 | Console.WriteLine("Eklemek istediğiniz kullanıcı bilgilerini giriniz");
37 | Console.WriteLine("Tc no:");
38 | string TcNo = Console.ReadLine();
39 | Console.WriteLine("Ad:");
40 | string PlayerName = Console.ReadLine();
41 | Console.WriteLine("Soyad:");
42 | string PlayerSurname = Console.ReadLine();
43 | Console.WriteLine("Doğum Yılı:");
44 | int BirthYear = Convert.ToInt32(Console.ReadLine());
45 | Console.WriteLine("Kaç yıl kullanmayı taahhüt ediyorsunuz:");
46 | int UndertakingYear = Convert.ToInt32(Console.ReadLine());
47 |
48 | playerManager.Add(new NewPlayer() { TcNo = TcNo, PlayerName = PlayerName, PlayerSurname = PlayerSurname, BirthYear = BirthYear, UndertakingYear = UndertakingYear });
49 | break;
50 | case 2:
51 | Console.WriteLine("Silmek istediğiniz oyuncunun Tc Numarasını giriniz:");
52 | playerManager.Delete(Console.ReadLine());
53 | break;
54 | case 3:
55 | playerManager.ListPlayer();
56 | break;
57 | case 4:
58 | Console.WriteLine("Eklemek istediğiniz oyunun bilgilerini giriniz");
59 | Console.WriteLine("Oyun Adı:");
60 | string GameName = Console.ReadLine();
61 | Console.WriteLine("Oyunun Çıkış Yılı:");
62 | int GameReleaseYear = Convert.ToInt32(Console.ReadLine());
63 | Console.WriteLine("Oyunun Türü:");
64 | string GameType = Console.ReadLine();
65 | Console.WriteLine("Oyunun Fiyatı:");
66 | double GamePrice = Convert.ToDouble(Console.ReadLine());
67 | Console.WriteLine("Oyunun İnceleme Puanı:");
68 | double GameReviewScore = Convert.ToDouble(Console.ReadLine());
69 |
70 | gameManager.Add(new Game() { GameName = GameName, GameReleaseYear = GameReleaseYear, GameType = GameType, GamePrice = GamePrice, GameReviewScore = GameReviewScore });
71 | break;
72 | case 5:
73 | Console.WriteLine("Silmek istediğiniz oyunun Adını giriniz:");
74 | gameManager.Delete(Console.ReadLine());
75 | break;
76 | case 6:
77 | gameManager.ListGame();
78 | break;
79 | case 7:
80 | gameManager.SortByReviewScores();
81 | break;
82 | case 8:
83 | gameManager.SortByReleaseYear();
84 | break;
85 | case 9:
86 | while (true)
87 | {
88 | Console.WriteLine("**********KAMPANYALAR**********");
89 | Console.WriteLine("-1-Öğrenci Kampanyası\n-2-Kara Cuma Kampanyası\n-3-Ana Menüye Dön");
90 | Console.WriteLine("*******************************");
91 |
92 | int choice2 = Convert.ToInt32(Console.ReadLine());
93 | Console.Clear();
94 |
95 | if (choice2 == 1 || choice2 == 2)
96 | {
97 | switch (choice2)
98 | {
99 | case 1:
100 | gameManager.ListGame();
101 | Console.WriteLine("Yukarıdaki oyunlardan öğrencisi kampanyası uygulamak istediğiniz oyunun adını yazınız:");
102 | string nameStudentCampaign = Console.ReadLine();
103 | Console.Clear();
104 | ICampaignService campaignStudent = new StudentCampaign();
105 | gameManager.GetGame(nameStudentCampaign, campaignStudent);
106 | break;
107 | case 2:
108 | gameManager.ListGame();
109 | Console.WriteLine("Yukarıdaki oyunlardan kara cuma kampanyası uygulamak istediğiniz oyunun adını yazınız:");
110 | string nameBlackFridayCampaign = Console.ReadLine();
111 | Console.Clear();
112 | ICampaignService campaignBlackFriday = new BlackFridayCampaign();
113 | gameManager.GetGame(nameBlackFridayCampaign, campaignBlackFriday);
114 | break;
115 | default:
116 | break;
117 | }
118 | }
119 |
120 | else
121 | {
122 | break;
123 | }
124 | }
125 | break;
126 |
127 | default:
128 | break;
129 | }
130 |
131 | }
132 | else
133 | {
134 | Console.WriteLine("Programdan çıkış yaptınız.\nİyi günler...");
135 | break;
136 | }
137 | }
138 | }
139 | }
140 | }
141 |
--------------------------------------------------------------------------------