c# - Exchanging data between classes -
I have a main square named main, in that main square there is a variable called state which type This is your question I understand, In this situation, the This is the responsibility of the example methods to update state variables. On completion of the execution of the example method, the collar can check the status that is in the example and then determine the next course of the appropriate action Please. A better approach is not to expose the state at all (unless there is no need to use it by external objects). In your case, it appears that the state is being used only to determine the method that is executed (I think you have a If you want to cover a particular method based on your situation, then you can leave this decision for yourself as an example, instead of taking the decision of the controller, The method can be ( int in state variable There is a state id that tells the program what it is in (menu, instructions screen ...) in the main category I have the object started with the class of class. Now my question is, how the object has been told that the state has been changed (it is easy, I can make it very easily but the next part is giving me problems), and how the object can tell the main square Is that what he wants to switch states?
The main is the controller class that invokes the
Sprite example methods
state determines the method that is called on it
Sprite example
phantom should have a fixed asset in the class, which is named
state (Preferably to be a
int instead of a
enum
switch statement to do this ).
update () or
Execute () ) that performs operations on the basis of operation context (like menu options, etc.). This method can execute the internal method based on the stable
state member.
Comments
Post a Comment