Closed oscarnava closed 4 months ago
After the commitment the tests failed, I will rewrite it.
In C# there is a difference between field and property. Fields are usually private and Properties are usually public.
cellMarked
must be a field here it is a property.
In C# there is a difference between field and property.
I've always wanted to explore C#; maybe you can be my mentor. 😉
Fields are usually private and Properties are usually public.
cellMarked
must be a field here it is a property.
The main issue is having an internal member (mainly a var
member) accessible from outside the class. This would allow anyone to alter the internal state of the instance without its knowledge. This is part of the encapsulation principle and we must avoid it.
I've refactored the
Cell
class. Among the changes: You had theisMarked
andisExplored
, which were bothvar
properties open to change from external code. That beats the encapsulation principle.Let me know what you think.