Posted 19 May 2015 - 09:38 PM
I think it would be a great addition/change to the ComputerCraft API would be to allow turtle upgrades (ITurtleUpgrade) and in-world peripherals (IPeripheral) to share the same logic. This would be most easily solved, I think, if the getType method for one of the interfaces was renamed, removing the conflict of different arguments, but same name and arguments. This would allow addon makers to easily change the logic for blocks that are both block-peripherals, and turtle-peripherals at the same time.
I'm sure some of you are thinking that a class can't be both for a turtle, and a tileEntity. You are right. I am talking about setting default methods on interfaces this allows to essentially implement the peripheral on any relevant class. Iam up for discussion on how this would be a great or terrible idea/why it would be very bad practice. Thanks for the time.
I'm sure some of you are thinking that a class can't be both for a turtle, and a tileEntity. You are right. I am talking about setting default methods on interfaces this allows to essentially implement the peripheral on any relevant class. Iam up for discussion on how this would be a great or terrible idea/why it would be very bad practice. Thanks for the time.