The Father
The Father
CC#
Created by The Father on 9/24/2024 in #help
✅ confusing list logic
i'll try that thanks
12 replies
CC#
Created by The Father on 9/24/2024 in #help
✅ confusing list logic
mm i can try sorting everything by descending numerical value first and then delete it in that order
12 replies
CC#
Created by The Father on 9/24/2024 in #help
✅ confusing list logic
how do you i suggest i remove them without moving the objects around for different iterations
12 replies
CC#
Created by The Father on 9/24/2024 in #help
✅ confusing list logic
which is what i'm trying to fix
12 replies
CC#
Created by olleeee on 9/23/2024 in #help
Binding problems, property not updating
Seems like you accidentally set both to the human player, when the first should be Player2
Square currentPlayerSquare = [HERE] Player1 [HERE].Board.First(s => s.Number == currentPlayer.Position);
Square otherPlayerSquare = [HERE] Player1 [HERE].Board.First(s => s.Number == otherPlayer.Position);
Square currentPlayerSquare = [HERE] Player1 [HERE].Board.First(s => s.Number == currentPlayer.Position);
Square otherPlayerSquare = [HERE] Player1 [HERE].Board.First(s => s.Number == otherPlayer.Position);
7 replies
CC#
Created by olleeee on 9/23/2024 in #help
Binding problems, property not updating
The logic is here, right?
public void PerformSwap(PlayerViewModel currentPlayer, Canvas canvas)
{
// Hitta en annan spelare att byta plats med
var otherPlayer = Players.FirstOrDefault(p => p != currentPlayer && p.Position > 0 && p.Position <= 100);
int otherPLayerposition = otherPlayer.Position; // det har lades till
int currentplayerposition = currentPlayer.Position; // det har lades till

if (otherPlayer != null)
{
// Byt plats på de två spelarna
Square currentPlayerSquare = Player1.Board.First(s => s.Number == currentPlayer.Position);
Square otherPlayerSquare = Player1.Board.First(s => s.Number == otherPlayer.Position);

currentPlayer.Position = otherPLayerposition; // och detta
otherPlayer.Position = currentplayerposition; // och detta!

MovePieceToCanvasPosition(currentPlayer.GamePiece, otherPlayerSquare, canvas);
MovePieceToCanvasPosition(otherPlayer.GamePiece, currentPlayerSquare, canvas);
}


}
public void PerformSwap(PlayerViewModel currentPlayer, Canvas canvas)
{
// Hitta en annan spelare att byta plats med
var otherPlayer = Players.FirstOrDefault(p => p != currentPlayer && p.Position > 0 && p.Position <= 100);
int otherPLayerposition = otherPlayer.Position; // det har lades till
int currentplayerposition = currentPlayer.Position; // det har lades till

if (otherPlayer != null)
{
// Byt plats på de två spelarna
Square currentPlayerSquare = Player1.Board.First(s => s.Number == currentPlayer.Position);
Square otherPlayerSquare = Player1.Board.First(s => s.Number == otherPlayer.Position);

currentPlayer.Position = otherPLayerposition; // och detta
otherPlayer.Position = currentplayerposition; // och detta!

MovePieceToCanvasPosition(currentPlayer.GamePiece, otherPlayerSquare, canvas);
MovePieceToCanvasPosition(otherPlayer.GamePiece, currentPlayerSquare, canvas);
}


}
7 replies
CC#
Created by olleeee on 9/23/2024 in #help
Binding problems, property not updating
though i don't know where the logic for that is in your code
7 replies
CC#
Created by olleeee on 9/23/2024 in #help
Binding problems, property not updating
i'd presume it's because you set the cpu's position before the player's position, and used the cpu's current position and the player's new position, rather than the cpu's old position
7 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
hm
572 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
because the null terminator?
572 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
ohh i didn't know that
572 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
hm
572 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
i know why TryParse is but no Parse
572 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
why is parse better
572 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
np
572 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
ez
572 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
float is 32 bit
572 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
double is just a 64 bit float
572 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
ToDouble
572 replies
CC#
Created by 'brella boy on 9/5/2024 in #help
✅ I DESPERATELY NEED HELP GETTING STARTED
when it converts it to an int it just rounds it
572 replies