using TPersistent as example
This commit is contained in:
parent
3783f6b52c
commit
ac79bf8ef7
@ -1,11 +1,22 @@
|
|||||||
export abstract class Assignable {
|
export interface Assignable {
|
||||||
protected data: Record<string, unknown> = {};
|
assign (a: Assignable): void;
|
||||||
|
assign_to (a: Assignable): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class Persistent {
|
||||||
|
private data: Record<string, unknown> = {};
|
||||||
|
private properties: Record<string, string>;
|
||||||
|
|
||||||
|
public constructor() {
|
||||||
|
this.properties = this.define_properties();
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract define_properties(): Record<string, string>;
|
||||||
|
|
||||||
public assign (da: Assignable): void {
|
public assign (da: Assignable): void {
|
||||||
this.assign_object (da.get_data ());
|
this.assign_object (da.get_data ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public assign_to (da: Assignable): void {
|
public assign_to (da: Assignable): void {
|
||||||
da.assign (this);
|
da.assign (this);
|
||||||
}
|
}
|
||||||
@ -18,4 +29,6 @@ export abstract class Assignable {
|
|||||||
public get_data (): Record<string, unknown> {
|
public get_data (): Record<string, unknown> {
|
||||||
return this.data;
|
return this.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wip
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user