<commit_before>import {computed, observable} from 'mobx';
import {FLOOR,ALIEN_FLOOR,FACEHUGGER_FLOOR,EGG_FLOOR} from '../constants';
import * as mobx from "mobx";

class GameStore {
  @observable characterPosition = {x: 300, y: FLOOR};
  @observable characterDirection = 1;
  @observable characterIsAttacking = false;
  @observable characterIsCrouching = false;
  @observable characterIsLatched = false;
  @observable stageX = 0;
  @observable heroLoopCount = 0;

  @observable levelCount = 0;
  @observable killCount = 0;

  @observable npcPositions = [
    {x: 900, y: ALIEN_FLOOR},
    {x: 600, y: ALIEN_FLOOR},
    {x: 600, y: ALIEN_FLOOR},
    {x: 600, y: ALIEN_FLOOR},
    {x: 600, y: ALIEN_FLOOR},
    {x: 800, y: ALIEN_FLOOR}
  ];

  @observable faceHuggerPositions = [];

  @observable eggPositions = [
    {x: 2800, y: EGG_FLOOR, hatched:false}
  ];

  constructor() {
    mobx.autorun(()=> this.reactToCrouch);
  }

  @computed get characterCrouch() {
    return this.characterIsCrouching;
  }

  @computed get reactToCrouch() {
    return console.log('character crouch -> ',this.characterCrouch);
  }

  setCharacterPosition(position) {
    this.characterPosition = position;
  }

  setCharacterDirection(direction) {
    this.characterDirection = direction;
  }

  setCharacterIsAttacking(isAttacking) {
    this.characterIsAttacking = isAttacking;
  }

  setCharacterIsCrouching(isCrouching) {
    this.characterIsCrouching = isCrouching;
  }

  setCharacterLatched(isLatched) {
    this.characterIsLatched = isLatched;
  }

  setNpcPosition(position, index) {
    this.npcPositions[index] = position;
  }
  setFaceHuggerPosition(position, index) {
    this.faceHuggerPositions[index] = position;
  }
  setEggPosition(position, index) {
    this.eggPositions[index] = position;
  }
  addFaceHugger(position) {
    this.faceHuggerPositions = [...this.faceHuggerPositions,position];
  }
  removeFaceHugger(npcIndex) {
    const removedFaceHugger = this.faceHuggerPositions.filter((faceHugger,i)=>{
      return i !== npcIndex;
    });
    this.faceHuggerPositions = removedFaceHugger;
  }

  setLevelCount(levelCount) {
    this.levelCount = levelCount;
    this.killCount = 0;
  }

  setStageX(x) {
    if (x > 0) {
      this.stageX = 0;
    } else if (x < -2048) {
      this.stageX = -2048;
    } else {
      this.stageX = x;
    }
  }

  setHeroLoopCount(count) {
    this.heroLoopCount = count;
  }

  setKillCount(count) {
    this.killCount = count;
  }
}

export default new GameStore();


<commit_msg>more egg<commit_after>import {computed, observable} from 'mobx';
import {FLOOR,ALIEN_FLOOR,FACEHUGGER_FLOOR,EGG_FLOOR} from '../constants';
import * as mobx from "mobx";

class GameStore {
  @observable characterPosition = {x: 300, y: FLOOR};
  @observable characterDirection = 1;
  @observable characterIsAttacking = false;
  @observable characterIsCrouching = false;
  @observable characterIsLatched = false;
  @observable stageX = 0;
  @observable heroLoopCount = 0;

  @observable levelCount = 0;
  @observable killCount = 0;

  @observable npcPositions = [
    {x: 900, y: ALIEN_FLOOR},
    {x: 600, y: ALIEN_FLOOR},
    {x: 600, y: ALIEN_FLOOR},
    {x: 600, y: ALIEN_FLOOR},
    {x: 600, y: ALIEN_FLOOR},
    {x: 800, y: ALIEN_FLOOR}
  ];

  @observable faceHuggerPositions = [];

  @observable eggPositions = [
    {x: 2800, y: EGG_FLOOR, hatched:false}
  ];

  constructor() {
    mobx.autorun(()=> this.reactToCrouch);
  }

  @computed get characterCrouch() {
    return this.characterIsCrouching;
  }

  @computed get reactToCrouch() {
    return console.log('character crouch -> ',this.characterCrouch);
  }

  setCharacterPosition(position) {
    this.characterPosition = position;
  }

  setCharacterDirection(direction) {
    this.characterDirection = direction;
  }

  setCharacterIsAttacking(isAttacking) {
    this.characterIsAttacking = isAttacking;
  }

  setCharacterIsCrouching(isCrouching) {
    this.characterIsCrouching = isCrouching;
  }

  setCharacterLatched(isLatched) {
    this.characterIsLatched = isLatched;
  }

  setNpcPosition(position, index) {
    this.npcPositions[index] = position;
  }
  setFaceHuggerPosition(position, index) {
    this.faceHuggerPositions[index] = position;
  }
  setEggPosition(position, index) {
    this.eggPositions[index] = position;
  }
  addFaceHugger(position) {
    this.faceHuggerPositions = [...this.faceHuggerPositions,position];
  }
  removeFaceHugger(npcIndex) {
    const removedFaceHugger = this.faceHuggerPositions.filter((faceHugger,i)=>{
      return i !== npcIndex;
    });
    this.faceHuggerPositions = removedFaceHugger;
  }

  setLevelCount(levelCount) {
    this.levelCount = levelCount;
    this.killCount = 0;
  }

  setStageX(x) {
    if (x > 0) {
      this.stageX = 0;
    } else if (x < -2048) {
      this.stageX = -2048;
    } else {
      this.stageX = x;
    }
  }

  setHeroLoopCount(count) {
    this.heroLoopCount = count;
  }

  setKillCount(count) {
    this.killCount = count;
  }
}

export default new GameStore();




{'fraction_non_alphanumeric': 0.12172878667724028, 'fraction_numerical': 0.01625693893735131, 'mean_word_length': 3.632690541781451, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '3372163', 'n_tokens_mistral': 1941, 'n_tokens_neox': 1794, 'n_words': 331}