Skip to content

Checkpoint2#15

Open
jamestglh wants to merge 8 commits intomasterfrom
checkpoint2
Open

Checkpoint2#15
jamestglh wants to merge 8 commits intomasterfrom
checkpoint2

Conversation

@jamestglh
Copy link
Owner

No description provided.

void CheckPlayerMove(){
//MOVEMENT CHECKS / TO
Checker checkerToMove = SelectChecker(fromX, fromY);
if (!validInput.Contains(toX) || !validInput.Contains(toY)) // CHECKS IF DESTINATION IS OUT OF BOUNDS
Copy link

@yousifS yousifS Sep 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you call SelectChecker(toX, toY) multiple times, could probably have made a targetChecker variable to hold that and used it.
Checker targetChecker = SelectChecker(toX,toY);

Seems like you are relying on the grid[toX,toY] to tell if the destination is empty square.
You could use the targetChecker to check, and that way the grid is just for drawing

 bool emptyTargetSpace = targetChecker == null;
bool isEnemyTarget = targetChecker == null ? false : targetChecker.color != checkerToMove.color;

public int[] position = new int[2];
public bool isWhite {get;private set;}

public int xPos {get;set;}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont see you making use or updating xPos and yPos.

int openCircleId = int.Parse(" 25CE", System.Globalization.NumberStyles.HexNumber);
string openCircle = char.ConvertFromUtf32(openCircleId);
int closedCircleId = int.Parse(" 25C9", System.Globalization.NumberStyles.HexNumber);
string closedCircle = char.ConvertFromUtf32(closedCircleId);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does not look like you are using openCircle or closedCircle anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants