Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hw-49
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chingiz
hw-49
Commits
fbd9b108
Commit
fbd9b108
authored
Mar 20, 2024
by
Chingiz
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hand class has been added
parent
b0a99ce2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
Hand.ts
src/Modules/Hand.ts
+23
-0
No files found.
src/Modules/Hand.ts
0 → 100644
View file @
fbd9b108
import
{
Card
}
from
"./Card"
;
class
Hand
{
private
limit
:
number
=
5
;
private
holdingCards
:
Card
[]
=
[];
receiveCard
(
card
:
Card
)
{
if
(
this
.
holdingCards
.
length
<=
this
.
limit
)
{
this
.
holdingCards
.
push
(
card
)
}
else
{
console
.
log
(
"Hand is full!"
)
}
}
showCards
(){
for
(
let
i
=
0
;
i
<
this
.
holdingCards
.
length
;
i
++
){
console
.
log
(
`Card#
${
i
}
) `
)
this
.
holdingCards
[
i
].
show
();
}
}
changeCard
(
newCard
:
Card
,
i
:
number
){
this
.
holdingCards
[
i
]
=
newCard
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment