Beta8397 / virtual_robot

A 2D robot simulator to help beginners learn Java programming for FTC Robotics
100 stars 171 forks source link

'remove(...)' methods added to HardwareMap and DeviceMapping. Reorganized robot configuration setup code. #70

Closed jkenney2 closed 3 years ago

jkenney2 commented 3 years ago

From @c4glenn: 'remove(...)' methods added to HardwareMap and DeviceMapping; these could be used if a subclass developer wants to exclude hardware elements that are included in the superclass. Also a new QQBot config class that extends TurretBot.

Reorganization of setup in bot config classes. Previously, 'createHardwareMap' abstract method (a subclass method) was called from the VirtualBot (superclass) constructor, before variable initialization and contructor execution in the subclass. createHardwareMap is now called from a VirtualBot 'initialize' method; all subclasses have 'initialize' methods, and the first statement in each is 'super.initialize()'. References to hardware devices are now obtained within the 'initialize' methods, rather than the constructors, of the robot configuration classes.