Search in sources :

Example 1 with ImmutableSuccessMateCommandPacket

use of me.retrodaredevil.solarthing.solar.outback.command.packets.ImmutableSuccessMateCommandPacket in project solarthing by wildmountainfarms.

the class OnMateCommandSent method onCommandExecute.

@Override
public void onCommandExecute(SourcedCommand<MateCommand> command) {
    OpenSource source = command.getSource();
    ExecutionReason reason = new OpenSourceExecutionReason(source);
    Packet packet = new ImmutableSuccessMateCommandPacket(SuccessMateCommandPacket.VERSION_LATEST, command.getCommand(), // for legacy reasons, include the data source converted to a string
    source.toDataSource().toString(), reason);
    packetListReceiver.receive(Collections.singletonList(packet));
}
Also used : Packet(me.retrodaredevil.solarthing.packets.Packet) SuccessMateCommandPacket(me.retrodaredevil.solarthing.solar.outback.command.packets.SuccessMateCommandPacket) ImmutableSuccessMateCommandPacket(me.retrodaredevil.solarthing.solar.outback.command.packets.ImmutableSuccessMateCommandPacket) OpenSource(me.retrodaredevil.solarthing.type.open.OpenSource) ExecutionReason(me.retrodaredevil.solarthing.reason.ExecutionReason) OpenSourceExecutionReason(me.retrodaredevil.solarthing.reason.OpenSourceExecutionReason) OpenSourceExecutionReason(me.retrodaredevil.solarthing.reason.OpenSourceExecutionReason) ImmutableSuccessMateCommandPacket(me.retrodaredevil.solarthing.solar.outback.command.packets.ImmutableSuccessMateCommandPacket)

Aggregations

Packet (me.retrodaredevil.solarthing.packets.Packet)1 ExecutionReason (me.retrodaredevil.solarthing.reason.ExecutionReason)1 OpenSourceExecutionReason (me.retrodaredevil.solarthing.reason.OpenSourceExecutionReason)1 ImmutableSuccessMateCommandPacket (me.retrodaredevil.solarthing.solar.outback.command.packets.ImmutableSuccessMateCommandPacket)1 SuccessMateCommandPacket (me.retrodaredevil.solarthing.solar.outback.command.packets.SuccessMateCommandPacket)1 OpenSource (me.retrodaredevil.solarthing.type.open.OpenSource)1