Score class
- Inheritance
-
- Object
- Widget
- RestActionAble
- Score
Constructors
-
Score(Entity entity, String score, {bool addNew = true, List<
Widget> ? commands, String type = 'dummy'}) - The Score class is the basis for setting values, calculating with scores and checking the values. It implements one base class with no functionality and several methods to do actions:
- Score.con(int number, {bool addNew = true, String type = 'dummy'})
-
Do you need constant values with scores? objD got you covered with
Score.con
: - Score.fromSelected(String score, {bool addNew = true, String type = 'dummy'})
- same as Score() but with a predefined entity(Entity.Selected(),)
- Score.str(String _strGen, {String score = '', String match = '0', String type = 'dummy'})
Properties
- called ↔ bool
-
Contains the Information, if this RestAction is already called (and can't be called again)
getter/setter pairinherited
-
commands
→ List<
Widget> -
Get commands
no setter
- entity → Entity
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- score ↔ String
-
getter/setter pair
- type ↔ String
-
getter/setter pair
-
writable
↔ List<
Widget> ? -
The writable list the RestAction writes it's contents on
getter/setter pairinherited
Methods
-
add(
[int val = 1]) → Score - adds a value to the score
-
addCommandRet(
Widget command) → Score -
addScore(
Score score) → Score - adds another score to this one
-
divideByScore(
Score score) → Score - sets this score to the result of the division
-
findBiggest(
List< Score> scores, {int? max}) → Widget - finds the biggest value in a list of scores
-
findSmallest(
List< Score> scores, {int? min}) → Widget - finds the smallest value in a list of scores
-
generate(
Context context) → Widget -
override
-
get(
) → Score - gets the value of the score to work with it further
-
getMatch(
) → String -
getString(
) → String -
isBigger(
Score score) → Score -
isBiggerOrEqual(
Score score) → Score -
isEqual(
Score score) → Score - tests
-
isSmaller(
Score score) → Score -
isSmallerOrEqual(
Score score) → Score -
matches(
int value) → Score -
matchesRange(
Range range) → Score -
modulo(
Score score) → Score - sets this score to the remainder of the division
-
multiplyByScore(
Score score) → Score - sets this score to the result of the multiplication
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queue(
[List< Widget> ? writable]) → void -
Execute this method to add this to the WidgetList (can use default list or as parameter given list)
This method can only be executed once, if it is executed multiple times you will get an Error. You can read out if it is already executed in the boolean Called
Example for a queue method:
inherited
-
reset(
) → Score - resets the value of a score
-
set(
int val) → Score - sets the score to a given value of int
-
setEqual(
Score score) → Score - sets this score equal to another
-
setTo(
dynamic other) → Widget - assign value(int, Score, Data or Condition)
-
setToBiggest(
Score score) → Score - compares two scores and sets the biggest to this one
-
setToCondition(
Condition cond, {bool useSuccess = false}) → Score - sets the score to the success of the given condition result
-
setToData(
Data data) → Score - sets the score to an nbt value
-
setToFunction(
File file) → Group - set to functions return value(or number of commands)
-
setToResult(
Command commmand, {bool useSuccess = false}) → Score - sets the score to the success of the given Command
-
setToSmallest(
Score score) → Score - compares two scores and sets the smallest to this one
-
setToWidget(
Widget widget, {bool useSuccess = false}) → Group - sets the score to the result of the given Widget JUST one Command should be the input
-
subtract(
[int val = 1]) → Score - subtracts a value from the score
-
subtractScore(
Score score) → Score - subtracts another score from this one
-
swapWith(
Score score) → Score - swaps two scores
-
toMap(
) → Map -
override
-
toString(
{Entity? entity, String? score}) → String -
A string representation of this object.
override
Operators
-
operator %(
dynamic other) → Score - modulo by
-
operator &(
dynamic other) → Score - matches
-
operator *(
dynamic other) → Score - multiply by
-
operator +(
dynamic other) → Score - add
-
operator -(
dynamic other) → Score - subtract
-
operator /(
dynamic other) → Score - divide by
-
operator <(
dynamic other) → Score - less than
-
operator <<(
dynamic other) → Widget -
operator <=(
dynamic other) → Score - less or equal
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >(
dynamic other) → Score - greater than
-
operator >=(
dynamic other) → Score - bigger or equal
-
operator >>(
dynamic other) → Widget