/*
* Copyright (c) 2023-2025 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
interface Mover {
getStatus(): { speed: number }
}
interface Shaker {
getStatus(): { frequency: number }
}
interface MoverShaker extends Mover, Shaker {
getStatus(): {
speed: number
frequency: number
}
}
class C implements MoverShaker {
private speed: number = 0
private frequency: number = 0
getStatus() {
return { speed: this.speed, frequency: this.frequency }
}
}
class MoveStatus {
public speed : number
constructor() {
this.speed = 0
}
}
interface Mover {
getMoveStatus(): MoveStatus
}
class ShakeStatus {
public frequency : number
constructor() {
this.frequency = 0
}
}
interface Shaker {
getShakeStatus(): ShakeStatus
}
class MoveAndShakeStatus {
public speed : number
public frequency : number
constructor() {
this.speed = 0
this.frequency = 0
}
}
class D implements Mover, Shaker {
private move_status : MoveStatus
private shake_status : ShakeStatus
constructor() {
this.move_status = new MoveStatus()
this.shake_status = new ShakeStatus()
}
public getMoveStatus() : MoveStatus {
return this.move_status
}
public getShakeStatus() : ShakeStatus {
return this.shake_status
}
public getStatus(): MoveAndShakeStatus {
return {
speed: this.move_status.speed,
frequency: this.shake_status.frequency
}
}
}