Phantom Variable within Object Method Calls

2 次查看(过去 30 天)
I have been working on a 3 dimensional version of battleship with starwars ships rather than battle ships. The issue I am running into is within the set function for the gameboard object. Each user, the AI and the Player, each are stored as an user class object, each of those have a display gameboard which displays the hits of each player and the set gameboard which stores the hits. The set1Boards function doesnt set the gameboard array to the set array, thats why I beleive there maybe be a bad call here or shadow variable. This current shows up in the multiplyPlace function first. Any possible solutions will help. The two relevant files are attached. The multiply function works and returns the correct variable.

回答(1 个)

Matt J
Matt J 2019-12-1
编辑:Matt J 2019-12-1
You must decide whether you want your classes to be handle classes or value classes.
Currently, you have made the value classes. You do not see in any change resulting from calls to class methods because you are not returning any object from those calls.

类别

Help CenterFile Exchange 中查找有关 Call Python from MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by