Skip to content

Commit

Permalink
refactor: simplify constructor in CommitmentBaseModel to use props fo…
Browse files Browse the repository at this point in the history
…r initialization
  • Loading branch information
BlackRam-oss committed Jan 29, 2025
1 parent d11655e commit 46bf3b2
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/classes/CommitmentBaseModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,14 @@ export default class CommitmentBaseModel extends CommitmentStoredClass {
room: RoomInterface,
props: CommitmentProps
) {
super(
id,
character ? (Array.isArray(character) ? character : [character]) : [],
room,
props.onRun,
props.executionType || "interaction",
props.priority || 0,
{
fromHour: props.fromHour,
toHour: props.toHour,
fromDay: props.fromDay,
toDay: props.toDay,
}
);
super(id, character ? (Array.isArray(character) ? character : [character]) : [], room, props.onRun, {
executionType: props.executionType,
priority: props.priority,
fromHour: props.fromHour,
toHour: props.toHour,
fromDay: props.fromDay,
toDay: props.toDay,
});
this._name = props.name || "";
this._image = props.image;
this.defaultDisabled = props.disabled || false;
Expand Down

0 comments on commit 46bf3b2

Please sign in to comment.