c++ - Passing many variables from a function in one class to a function in another class -
c++ - Passing many variables from a function in one class to a function in another class -
i creating chess engine using bitboards , have 2 classes: class board
, class evaluation
.
there many variables in board
class want pass function in evaluation
class. class evaluates position of board , returns number. want pass bitboards class. around 15 in number , may increase.
i creating object of evaluation
class in board
class , board
class calling boardevaluation
function. function want pass these bitboards.
one way take 15 arguments in function want pass variables to. however, prefer not using approach since not sound appealing.
is there other way pass many variables 1 class function in class?
create class boarddata
, utilize in both board
, evaluation
. responsibility of boarddata
store 15 variables - , maybe provide basic operations on them. in way design simplified without circural depependencies.
c++
Comments
Post a Comment