, i3(0), i4(0)
, b(false)
, type(ARRAY_VALUES) {
-
+ if (!v.empty()) {
+ typeName = v.front()->GetLiteral().GetTypeName();
+ }
}
-Literal::Literal(const std::vector<PropertyList *> &pls)
+Literal::Literal(const string &typeName, const vector<PropertyList *> &pls)
: props(0)
+, typeName(typeName)
, propertyLists(pls)
, i1(0), i2(0)
, i3(0), i4(0)
Literal::Literal(bool b)
: props(0)
+, typeName("Boolean")
, i1(0), i2(0)
, i3(0), i4(0)
, b(b)
Literal::Literal(int r, int g, int b, int a)
: props(0)
+, typeName("Color")
, i1(r), i2(g)
, i3(b), i4(a)
, b(false)
Literal::Literal(int number)
: props(0)
+, typeName("Number")
, i1(number), i2(0)
, i3(0), i4(0)
, b(false)
Literal::Literal(const string &dir, const string &path)
: props(0)
+, typeName("Path")
, str(CatPath(dir, path))
, i1(0), i2(0)
, i3(0), i4(0)
Literal::Literal(const string &str)
: props(0)
+, typeName("String")
, str(str)
, i1(0), i2(0)
, i3(0), i4(0)
Literal::Literal(int x, int y)
: props(0)
+, typeName("Vector")
, i1(x), i2(y)
, i3(0), i4(0)
, b(false)
Literal::Literal(const string &typeName, PropertyList *properties)
: props(properties)
-, str(typeName)
+, typeName(typeName)
, i1(0), i2(0)
, i3(0), i4(0)
, b(false)
}
const string &Literal::GetTypeName() const {
- if (type == OBJECT) {
- return str;
- } else {
- throw runtime_error("tried to access type name of non-object literal");
- }
+ return typeName;
}
const PropertyList *Literal::GetProperties() const {
sprite: lizardSprite,
frametime: fourFramesTime,
repeat: false,
- frames: [
+ frames:
+ [ ComplexAnimationFrame
{ column: 0, row: 1, disposition: < 0, 16> },
{ column: 0, row: 0, disposition: < 0, 16> },
{ column: 0, row: 1, disposition: < 0, 16> },
sprite: maximSprite,
frametime: frameTime,
repeat: false,
- frames: [
+ frames:
+ [ ComplexAnimationFrame
{ column: 1, row: 0, disposition: < 0, 0> },
{ column: 1, row: 0, disposition: < 0, 0> },
{ column: 1, row: 0, disposition: < 0, 0> },
sprite: maximSprite,
frametime: fiveFramesTime,
repeat: false,
- frames: [
+ frames:
+ [ ComplexAnimationFrame
{ column: 3, row: 0, disposition: < 0, 0> },
{ column: 3, row: 0, disposition: < 0, 0> },
{ column: 3, row: 1, disposition: < 0, 0> }
sprite: selanSprite,
frametime: frameTime,
repeat: false,
- frames: [
+ frames:
+ [ ComplexAnimationFrame
{ column: 1, row: 0, disposition: < 4, 0> },
{ column: 1, row: 0, disposition: < 4, 0> },
{ column: 1, row: 0, disposition: < 8, 2> },
sprite: selanSprite,
frametime: frameTime,
repeat: false,
- frames: [
+ frames:
+ [ ComplexAnimationFrame
{ column: 3, row: 0, disposition: < 0, 0> },
{ column: 3, row: 0, disposition: < 0, 0> },
{ column: 3, row: 0, disposition: < 0, 0> },
sprite: guySprite,
frametime: frameTime,
repeat: false,
- frames: [
+ frames:
+ [ ComplexAnimationFrame
{ column: 1, row: 0, disposition: <-4, 0> },
{ column: 1, row: 0, disposition: <-4, 0> },
{ column: 1, row: 0, disposition: <-8, 0> },
sprite: dekarSprite,
frametime: frameTime,
repeat: false,
- frames: [
+ frames:
+ [ ComplexAnimationFrame
{ column: 1, row: 0, disposition: < 4, 0> },
{ column: 1, row: 0, disposition: < 8, 2> },
{ column: 2, row: 0, disposition: <12, 4> },
sprite: dekarSprite,
frametime: twoFramesTime,
repeat: false,
- frames: [
+ frames:
+ [ ComplexAnimationFrame
{ column: 3, row: 0, disposition: < 0, 0> },
{ column: 3, row: 0, disposition: < 0, 0> },
{ column: 3, row: 0, disposition: < 0, 0> },
numberAnimationPrototype: ComplexAnimation {
frametime: frameTime,
repeat: false,
- frames: [
+ frames:
+ [ ComplexAnimationFrame
{ column: 0, row: 0, disposition: < 0, 0> },
{ column: 0, row: 0, disposition: < 0,-26> },
{ column: 0, row: 0, disposition: < 0,-42> },