Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move require statements to the beginning #6

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion client/lib/lighting.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const {Component} = require('../index.js');
const Component = require('./component.js');

class LightingObject extends Component {
constructor(atom, template) {
Expand Down
2 changes: 1 addition & 1 deletion lib/atom/component.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
const EventEmitter = require('events');
const mob_symbols = require('./mob.js')._symbols;
const mob_symbols = require('./mob/symbols.js');
const _networked_vars = Symbol('_networked_vars');

/**
Expand Down
3 changes: 2 additions & 1 deletion lib/atom/lighting.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const {Component, Atom} = require('../server.js');
const Atom = require('./atom.js');
const Component = require('./component.js');

const _enabled = Symbol('_enabled');
const _color = Symbol('_color');
Expand Down
36 changes: 19 additions & 17 deletions lib/atom/mob.js → lib/atom/mob/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
'use strict';

const {chain_func, is_atom, to_chat, has_component} = require('../utils.js');
const _observers = Symbol('_observers');
const _viewers = Symbol('_viewers');
const _viewing = Symbol('_viewing');
const _key = Symbol('_key');
const _client = Symbol('_client');
const _server_to_net = Symbol('_server_to_net');
const _visible_tiles = Symbol('_visible_tiles');
const _screen_set = Symbol('_screen_set');
const _update_var = Symbol('_update_var');
const _add_viewing = Symbol('_add_viewing');
const _remove_viewing = Symbol('_remove_viewing');
const _common_tiles_count = Symbol('_common_tiles_count');
const _panel_map = Symbol('_panel_map');
const _visgroups = Symbol('_visgroups');
const _eye_to_eyeid = Symbol('_eye_to_eyeid');
module.exports._symbols = {_observers, _client, _viewers, _viewing, _visible_tiles, _server_to_net, _add_viewing, _remove_viewing, _update_var, _common_tiles_count, _visgroups, _key};
const _symbols = require('./symbols.js');

const _observers = _symbols._observers;
Kinrany marked this conversation as resolved.
Show resolved Hide resolved
const _viewers = _symbols._viewers;
const _viewing = _symbols._viewing;
const _key = _symbols._key;
const _client = _symbols._client;
const _server_to_net = _symbols._server_to_net;
const _visible_tiles = _symbols._visible_tiles;
const _screen_set = _symbols._screen_set;
const _update_var = _symbols._update_var;
const _add_viewing = _symbols._add_viewing;
const _remove_viewing = _symbols._remove_viewing;
const _common_tiles_count = _symbols._common_tiles_count;
const _panel_map = _symbols._panel_map;
const _visgroups = _symbols._visgroups;
const _eye_to_eyeid = _symbols._eye_to_eyeid;
module.exports._symbols = _symbols;

const Component = require('./component.js');

Expand Down Expand Up @@ -75,7 +77,7 @@ class Eye extends Component {

if(this.a.c.Hearer)
this.a.c.Hearer.show_message = chain_func(this.a.c.Hearer.show_message, this.show_message.bind(this));

/** @type {boolean} */this.xray;
}

Expand Down
17 changes: 17 additions & 0 deletions lib/atom/mob/symbols.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const _observers = Symbol('_observers');
const _viewers = Symbol('_viewers');
const _viewing = Symbol('_viewing');
const _key = Symbol('_key');
const _client = Symbol('_client');
const _server_to_net = Symbol('_server_to_net');
const _visible_tiles = Symbol('_visible_tiles');
const _screen_set = Symbol('_screen_set');
const _update_var = Symbol('_update_var');
const _add_viewing = Symbol('_add_viewing');
const _remove_viewing = Symbol('_remove_viewing');
const _common_tiles_count = Symbol('_common_tiles_count');
const _panel_map = Symbol('_panel_map');
const _visgroups = Symbol('_visgroups');
const _eye_to_eyeid = Symbol('_eye_to_eyeid');

module.exports = {_observers, _client, _viewers, _viewing, _visible_tiles, _server_to_net, _add_viewing, _remove_viewing, _update_var, _common_tiles_count, _visgroups, _key};