Improved workspace structure
This commit is contained in:
13
cc_code_preview/Preview/classes.cc
Normal file
13
cc_code_preview/Preview/classes.cc
Normal file
@@ -0,0 +1,13 @@
|
||||
public lib Preview.Classes {
|
||||
public class Test {
|
||||
private var _name: string;
|
||||
|
||||
public constructor(name: string) {
|
||||
this._name = name;
|
||||
}
|
||||
|
||||
public getName(): string {
|
||||
return this._name;
|
||||
}
|
||||
}
|
||||
}
|
5
cc_code_preview/Preview/functions.cc
Normal file
5
cc_code_preview/Preview/functions.cc
Normal file
@@ -0,0 +1,5 @@
|
||||
public lib Preview.Functions {
|
||||
public func isTrue(value: bool): bool {
|
||||
return value;
|
||||
}
|
||||
}
|
8
cc_code_preview/Preview/variables.cc
Normal file
8
cc_code_preview/Preview/variables.cc
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
public lib Preview.Variables {
|
||||
public var str: string = "Hello World";
|
||||
public var test: bool = false;
|
||||
public var test2: Test = empty;
|
||||
public var test3: Test = Test(34);
|
||||
}
|
19
cc_code_preview/Program/main.cc
Normal file
19
cc_code_preview/Program/main.cc
Normal file
@@ -0,0 +1,19 @@
|
||||
use Preview.Variables;
|
||||
use Preview.Functions;
|
||||
use Preview.Classes;
|
||||
|
||||
public lib Main {
|
||||
public class Program {
|
||||
private var test: Test;
|
||||
|
||||
public constructor() {
|
||||
this.test = Test(str);
|
||||
}
|
||||
|
||||
public func Main(): void {
|
||||
output(str, test, test2, test3);
|
||||
output(isTrue(test));
|
||||
output(this.test.getName());
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user