<commit_before>import Command from './command.js';
import {functionVariables} from './cmdVariables.js';
import store from '../store.jsx';

export class If extends Command {
  constructor(condition) {
    super('IF', true)
    this.condition = condition;
  }

  executeCommand() {
    if (this.condition.executeCommand()) {
      this.executeCallbacks()
    }
  }
}

export class IfNot extends Command {
  constructor(condition) {
    super('IFNOT', true)
    this.condition = condition;
  }

  executeCommand() {
    if (this.condition.executeCommand() === false) {
      this.executeCallbacks()
    }
  }
}

const redTileCheck = () => {
    const redTile = [store.getState().transition.redTile.xGrid, store.getState().redTile.yGrid];
    const spriteCoord = [store.getState().transition.xGrid, store.getState().transition.yGrid]
    if (redTile[0] === spriteCoord[0] && redTile[1] === spriteCoord[1]) return true;
}

export class Condition {
  constructor(left = null, right = null, comparison = null) {
    this.left = left
    this.right = right
    this.comparison = comparison
  }

  executeCommand() {
    return redTileCheck();
  }
}<commit_msg>created If Not class in cmd obj and added red tile check in cmd obj condition class<commit_after>import Command from './command.js';
import {functionVariables} from './cmdVariables.js';
import store from '../store.jsx';

export class If extends Command {
  constructor(condition) {
    super('IF', true)
    this.condition = condition;
  }

  executeCommand() {
    if (this.condition.executeCommand()) {
      this.executeCallbacks()
    }
  }
}

export class IfNot extends Command {
  constructor(condition) {
    super('IFNOT', true)
    this.condition = condition;
  }

  executeCommand() {
    if (this.condition.executeCommand() === false) {
      this.executeCallbacks()
    }
  }
}

const redTileCheck = () => {
    const redTile = [store.getState().transition.redTile.xGrid, store.getState().redTile.yGrid];
    const spriteCoord = [store.getState().transition.xGrid, store.getState().transition.yGrid]
    if (redTile[0] === spriteCoord[0] && redTile[1] === spriteCoord[1]) return true;
}

export class Condition {
  constructor(condition, left = null, right = null, comparison = null) {
    this.left = left
    this.right = right
    this.comparison = comparison
    this.condition = condition;
  }

  executeCommand() {
    if (this.condition === 'redTile') return redTileCheck();
  }
}
{'fraction_non_alphanumeric': 0.13953488372093023, 'fraction_numerical': 0.0032639738882088943, 'mean_word_length': 3.5661080074487894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7538956', 'n_tokens_mistral': 741, 'n_tokens_neox': 725, 'n_words': 174}