protected override void Execute(InteractiveObject obj, Command command) { Interface interfaceObject = obj as Interface; if (interfaceObject == null) { //interface not exist return; } if (interfaceObject.IsActive == false) { ResponseManager.Instance.InterfaceNotActive(WhoAmI.ToString() + '>'); return; } if (command.IssuedCommand == AvailableCommands.Interface) { if (interfaceObject.IsGained == true) { ResponseManager.Instance.NoResources(WhoAmI.ToString() + '>'); return; } obj.Use(); ResponseManager.Instance.GainedResources(WhoAmI.ToString() + '>', "NavCoords: " + interfaceObject.NavCoordsReward); } else if (command.IssuedCommand == AvailableCommands.ToggleDefenseSystems) { interfaceObject.ToggleDefenseSystem(); ResponseManager.Instance.ToggleDefenseSystem(WhoAmI.ToString() + '>'); } }
private void GoToTargetInterface(Command command, Drone drone) { InteractiveObject interfaceObject = ObjectsManager.Instance.GetObject(0, CommandReceivers.Interface); if (interfaceObject == null) { // _response?.Invoke(InterfaceNotExistResponse(command)); return; } drone.SetDestination(interfaceObject.gameObject.transform.position); ResponseManager.Instance.DroneMoveTo(WhoAmI.ToString() + drone.Id.ToString() + '>', "Interface"); }
private void GoToTargetRoom(Command command, Drone drone) { int targetRoomId = command.Args[0]; Room room = RoomManager.Instance.GetRoomById(targetRoomId); if (room == null) { ResponseManager.Instance.RoomNotExist(WhoAmI.ToString() + drone.Id.ToString() + '>', command.Args[0].ToString()); return; } Vector3 targetRoomCenterPosition = room.GetCenter(); drone.SetDestination(targetRoomCenterPosition); ResponseManager.Instance.DroneMoveTo(WhoAmI.ToString() + drone.Id.ToString() + '>', "room " + command.Args[0].ToString()); }
protected override void Execute(InteractiveObject obj, Command command) { obj.Use(); ResponseManager.Instance.UsedAirlock(WhoAmI.ToString() + '>', command.ReceiverID.ToString()); }