C# Class DeenGames.Valence.Model.CoreModel

Show file Open project: deengames/valence

Public Methods

Method Description
BoardToString ( ) : string
ClearEventHandlers ( ) : void
CreateBoard ( ) : void
GenerateBoard ( ) : void
IsLevelOver ( ) : bool
LoadBoard ( int puzzleLevel ) : void
MoveToNextLevel ( ) : void
PickNextAtom ( ) : void
SaveLevelReached ( ) : void
SetGameStateToNormal ( ) : void
SignalGameOver ( ) : void
SpewOutAtomsFromMachine ( ) : IList
StartAtFirstLevel ( ) : void
StartCountdownTimer ( ) : void
StopCountdownTimer ( ) : void
_countdownTickTimer_Tick ( object sender, EventArgs e ) : void

Private Methods

Method Description
CoreModel ( ) : System
GetPuzzleBoardAndToolboxDefinition ( int puzzleLevel ) : string
GetTilesInReaction ( Tile newAtomTile ) : IList
SetGameStateToGameComplete ( ) : void
calculateReactionsUsingBestFirstSearch ( IList potentialReactionTiles, Tile centerTile, IList foundSoFarInPath, IList foundSoFarInTotal ) : IList
calculateReactionsUsingBruteForceCombinations ( IList potentialReactionTiles, Tile userClickedTile ) : IList
clearBoard ( ) : void
countEmptyTilesOnTheBoard ( ) : int
generateNormalModeBoard ( ) : void
generatePuzzleModeLevel ( ) : void
getCombinationsOf ( int i, IList potentialReactionTiles, Tile userClickedTile ) : IList
getCombinationsOfTwo ( IList potentialReactionTiles, Tile userClickedTile ) : IList
getIncrementalCombinations ( IList potentialReactionTiles, IList previousSet ) : IList
getMostElectronegative ( IList molecules ) : Molecule
getNonEmptyAdjacentTiles ( Tile centerTile ) : IList
getPotentialReactionTiles ( Tile centerTile, IList toReturn ) : void

Get potential reaction tiles. These are non-empty tiles that are non-diagonally adjacent to centerTile. This also includes tiles that are adjacent to adjacent tiles.

loadLastReachedLevel ( ) : void
tileFollowsDifficultyBalancingAlgorithm ( Tile current, Atom proposedAtom ) : bool
weedOutNonConnectedMolecules ( IList molecules ) : IList

Given a list of potential molecules, weed out all the ones where the atoms are not all adjacent to each other. This can occur due to a bug-fix for I-shaped molecules not reacting, where we extended molecule detection to all non-empty adjacent tiles. As a result, you can have H-Be-Cl forming H-Cl, which is wrong. This function will fix that, by checking that H and Cl are adjacent.

Method Details

BoardToString() public method

public BoardToString ( ) : string
return string

ClearEventHandlers() public method

public ClearEventHandlers ( ) : void
return void

CreateBoard() public method

public CreateBoard ( ) : void
return void

GenerateBoard() public method

public GenerateBoard ( ) : void
return void

IsLevelOver() public method

public IsLevelOver ( ) : bool
return bool

LoadBoard() public method

public LoadBoard ( int puzzleLevel ) : void
puzzleLevel int
return void

MoveToNextLevel() public method

public MoveToNextLevel ( ) : void
return void

PickNextAtom() public method

public PickNextAtom ( ) : void
return void

SaveLevelReached() public method

public SaveLevelReached ( ) : void
return void

SetGameStateToNormal() public method

public SetGameStateToNormal ( ) : void
return void

SignalGameOver() public method

public SignalGameOver ( ) : void
return void

SpewOutAtomsFromMachine() public method

public SpewOutAtomsFromMachine ( ) : IList
return IList

StartAtFirstLevel() public method

public StartAtFirstLevel ( ) : void
return void

StartCountdownTimer() public method

public StartCountdownTimer ( ) : void
return void

StopCountdownTimer() public method

public StopCountdownTimer ( ) : void
return void

_countdownTickTimer_Tick() public method

public _countdownTickTimer_Tick ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void