Scenario class

A Scenario contains information about the positions of the actors in the world.

The actors are described with the following signs:

  • Player: @
  • Tree: %
  • Star: .
  • Box: $
  • Box on star: *
  • Player on star: +

The background:

  • Empty: a space
  • Border or holes: #

Note: The border must form a polygon with the actors inside.

Constructors

Scenario({String title = 'untitled', List<String> positions = const ['@']})
Creates a Scenario with specified title and positions of actors and background tiles.

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
positions List<String>
Actor and background positions. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
title String
The title of the Scenario.
final

Methods

build(World world) → void
Builds a list of Actors according to this Scenario.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

parse(String scenarioString, String file) Scenario
Parses the scenarioString and creates a Scenario. [...]

Constants

borderOrHole → const String
'#'
box → const String
r'$'
boxStar → const String
'*'
empty → const String
' '
player → const String
'@'
playerStar → const String
'+'
star → const String
'.'
tree → const String
'%'
undefined → const String
'?'