Class: Modsvaskr::Game

Inherits:
Object
  • Object
show all
Includes:
Logger, RunCmd
Defined in:
lib/modsvaskr/game.rb

Overview

Common functionality for any Game

Direct Known Subclasses

Modsvaskr::Games::SkyrimSe

Instance Method Summary collapse

Methods included from Logger

#log

Methods included from RunCmd

#run_cmd

Constructor Details

#initialize(config, game_info) ⇒ Game

Constructor

Parameters
  • config (Config): The config

  • game_info (Hash<String,Object>): Game info:

    • name (String): Game name

    • path (String): Game installation dir



19
20
21
22
23
24
# File 'lib/modsvaskr/game.rb', line 19

def initialize(config, game_info)
  @config = config
  @game_info = game_info
  @name = name
  init if self.respond_to?(:init)
end

Instance Method Details

#launch_exeObject

Return the launch executable

Result
  • String: Launch executable



46
47
48
# File 'lib/modsvaskr/game.rb', line 46

def launch_exe
  @game_info['launch_exe']
end

#nameObject

Return the game name

Result
  • String: Game name



30
31
32
# File 'lib/modsvaskr/game.rb', line 30

def name
  @game_info['name']
end

#pathObject

Return the game path

Result
  • String: Game path



38
39
40
# File 'lib/modsvaskr/game.rb', line 38

def path
  @game_info['path']
end

#xeditObject

Return an xEdit instance for this game

Result
  • Xedit: The xEdit instance



54
55
56
57
# File 'lib/modsvaskr/game.rb', line 54

def xedit
  @xedit = Xedit.new(@config.xedit_path, path) unless defined?(@xedit)
  @xedit
end