



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Instructions on how to implement the singleton design pattern in the stratego class. The singleton design pattern ensures that a class has one instance and provides a global point of access to it. The document also includes modifications to the tokenhandler, stratego, board, space, and token classes for labs 6 and 7. The description covers the purpose of the singleton design pattern, its implementation in the stratego class, and modifications to existing classes.
Typology: Lab Reports
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Modifications to Existing Classes
public boolean validateMove(Space start, Space end)
public int strike(Token attacked)
+valida teMove(start Sp ace, end : S pace) : boolean +str ike( attacked : Toke n) : int
Token
+valida teMove(start : S pace, en d : Space) : boo lean
FixedToken +valida teMove(start : S pace, en d : Space) : boo lean
ScoutToken
+strike (attacked : Token) : int
MinerTok en +strike(attacke d : To ken ) : int
SpyToken
Grading