-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added relationships category builder
- Loading branch information
Meshulam Silk
committed
Apr 12, 2015
1 parent
238717f
commit fe033bd
Showing
5 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
lib/src/312/categories/relationships_geek_code_category.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Copyright (c) 2015, Meshulam Silk ([email protected]). All rights reserved. Use of this source code | ||
// is governed by a BSD-style license that can be found in the LICENSE file. | ||
|
||
part of geek_code.v312; | ||
|
||
/** | ||
* Class that builds [DressGeekCodeCategory]s. | ||
* | ||
* Adds 2 variable setting methods: | ||
* | ||
* * [crossDresser] | ||
* * [sameClothes] | ||
*/ | ||
class RelationshipsGeekCodeCategoryBuilder extends ExtremeGenericGeekCodeCategoryBuilder { | ||
bool _dumped = false; | ||
|
||
/** | ||
* Creates a new [DressGeekCodeCategoryBuilder] object. | ||
* | ||
* See [GeekCodeCategoryBuilder.GeekCodeCategoryBuilder] for a description of the parameters. | ||
*/ | ||
RelationshipsGeekCodeCategoryBuilder(String code, int minGrade, int maxGrade) : super(code, minGrade, maxGrade); | ||
|
||
/** | ||
* Original documentation: | ||
* | ||
* r% | ||
* I was going out with someone, but the asshole dumped me. | ||
*/ | ||
RelationshipsGeekCodeCategory dumped() { | ||
this._dumped = true; | ||
return subValidate(null, false, false); | ||
} | ||
|
||
/** | ||
* Returns a [DressGeekCodeCategory] without performing any additional validations. | ||
* | ||
* See [GeekCodeCategoryBuilder.subValidate] for a fuller explanation of this method. | ||
*/ | ||
RelationshipsGeekCodeCategory subValidate(GeekCodeGrade grade, bool refuse, bool noKnowledge) => new RelationshipsGeekCodeCategory(this, grade); | ||
} | ||
|
||
/** | ||
* Original documentation: | ||
* | ||
* It is said that "clothes make the man". Well, I understood that I was made by a mommy and a daddy (and there's even a category to describe the process below!). Maybe the people who made up that saying aren't being quite that literal... | ||
*/ | ||
class RelationshipsGeekCodeCategory extends ExtremeGeekCodeCategory { | ||
final RelationshipsGeekCodeCategoryBuilder _builder; | ||
|
||
/** | ||
* See [GeekCodeCategory.GeekCodeCategory] for a description of the parameters. | ||
*/ | ||
RelationshipsGeekCodeCategory(RelationshipsGeekCodeCategoryBuilder builder, GeekCodeGrade grade) | ||
: this._builder = builder, | ||
super(builder, grade); | ||
|
||
String toString() => super.toString() + (_builder._dumped ? "%" : ""); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: geek_code | ||
version: 1.1.0 | ||
version: 2.0.0 | ||
author: Meshulam Silk <[email protected]> | ||
description: Dart implementation of The Geek Code | ||
homepage: http://moomoohk.github.io/projects/geek_code | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters