public abstract void packToString(GameRuleSerializer serializer);
public override void packToString(GameRuleSerializer serializer) { serializer.packByte(GAME_RULE_CONDITION_BIT_SIZE, GAME_RULE_ZONE_CONDITION_BYTE_VAL); serializer.packToString(zoneType, Zone.standardZoneTypes); selector.packToStringAsSourceSelector(serializer); }
public override void packToString(GameRuleSerializer serializer) { serializer.packByte(GAME_RULE_META_RULE_BIT_SIZE, GAME_RULE_PLAYER_SWAP_META_RULE_BYTE_VAL); }
public override void packToString(GameRuleSerializer serializer) { serializer.packByte(GAME_RULE_ACTION_BIT_SIZE, GAME_RULE_META_RULE_ACTION_BYTE_VAL); innerMetaRule.packToString(serializer); }
public override void packToString(GameRuleSerializer serializer) { serializer.packByte(GAME_RULE_SELECTOR_BIT_SIZE, GAME_RULE_BALL_SHOOTER_SELECTOR_BYTE_VAL); }
public void packToString(GameRuleSerializer serializer) { condition.packToString(serializer); action.packToString(serializer); }
public override void packToStringAsSourceSelector(GameRuleSerializer serializer) { serializer.packByte(GAME_RULE_SOURCE_SELECTOR_BIT_SIZE, GAME_RULE_BALL_SOURCE_SELECTOR_BYTE_VAL); }
public override void packToString(GameRuleSerializer serializer) { serializer.packByte(GAME_RULE_ACTION_DURATION_BIT_SIZE, GAME_RULE_ACTION_FIXED_DURATION_BYTE_VAL); //we'll just save N bits, so from 0 to (2^N-1) serializer.packByte(DURATION_SERIALIZATION_BIT_COUNT, (byte)(duration & DURATION_SERIALIZATION_MASK)); }
public override void packToString(GameRuleSerializer serializer) { serializer.packByte(GAME_RULE_EFFECT_BIT_SIZE, GAME_RULE_FREEZE_EFFECT_BYTE_VAL); base.packToString(serializer); }
public override void packToString(GameRuleSerializer serializer) { serializer.packByte(GAME_RULE_EFFECT_BIT_SIZE, GAME_RULE_POINTS_PLAYER_EFFECT_BYTE_VAL); //we'll just save N bits of the points, so one of the (2^N) consecutive values <= POINTS_SERIALIZATION_MAX_VALUE serializer.packByte(POINTS_SERIALIZATION_BIT_COUNT, (byte)(pointsGiven & POINTS_SERIALIZATION_MASK)); }
public override void packToString(GameRuleSerializer serializer) { serializer.packByte(GAME_RULE_ACTION_BIT_SIZE, GAME_RULE_EFFECT_ACTION_BYTE_VAL); selector.packToString(serializer); innerEffect.packToString(serializer); }
public override void packToString(GameRuleSerializer serializer) { duration.packToString(serializer); }
public override void packToString(GameRuleSerializer serializer) { serializer.packByte(GAME_RULE_ACTION_DURATION_BIT_SIZE, GAME_RULE_ACTION_UNTIL_CONDITION_DURATION_BYTE_VAL); untilCondition.packToString(serializer); }
public override void packToString(GameRuleSerializer serializer) { //pack the condition type serializer.packByte(GAME_RULE_CONDITION_BIT_SIZE, GAME_RULE_EVENT_HAPPENED_CONDITION_BYTE_VAL); packToStringAsEventHappenedCondition(serializer); }
public abstract void packToStringAsSourceSelector(GameRuleSerializer serializer);
//until-condition durations know that their condition is an event, so we don't need to save the condition type public void packToStringAsEventHappenedCondition(GameRuleSerializer serializer) { //pack the event type serializer.packToString(eventType, GameRuleEvent.eventTypesList); //pack our source and target types serializer.packToString(sourceType, GameRuleEvent.eventTypeSourcesList[eventType]); serializer.packToString(targetType, GameRuleEvent.potentialEventsList[eventType][sourceType]); //pack the param if applicable if (targetType == typeof(FieldObject)) serializer.packToString(param, FieldObject.standardFieldObjects); }
public override void packToString(GameRuleSerializer serializer) { serializer.packByte(GAME_RULE_ACTION_DURATION_BIT_SIZE, GAME_RULE_ACTION_UNTIL_CONDITION_DURATION_BYTE_VAL); triggerSelector.packToString(serializer); //this saves us a couple bits and a little time untilCondition.packToStringAsEventHappenedCondition(serializer); }