mirror of
https://github.com/CorsixTH/CorsixTH.git
synced 2025-07-23 04:13:01 +02:00
Codespell changes
This commit is contained in:
@@ -285,7 +285,7 @@ frmMain::frmMain()
|
||||
1, wxEXPAND);
|
||||
pMoodOverlay->Add(pMoodRow, 1, wxEXPAND | wxALL, 2);
|
||||
pMoodOverlay->Add(
|
||||
new wxCheckBox(this, ID_DRAW_COORDINATES, L"Draw tile coodinates"), 0,
|
||||
new wxCheckBox(this, ID_DRAW_COORDINATES, L"Draw tile coordinates"), 0,
|
||||
wxEXPAND | wxALL, 0);
|
||||
pSidebarSizer->Add(pMoodOverlay, 0, wxEXPAND | wxALL, 0);
|
||||
m_bDrawMood = false;
|
||||
@@ -413,7 +413,7 @@ void frmMain::load() {
|
||||
sPath += wxFileName::GetPathSeparator();
|
||||
}
|
||||
if (!wxFileName::DirExists(sPath)) {
|
||||
::wxMessageBox(L"Theme Hospital path non-existant", L"Load Animations",
|
||||
::wxMessageBox(L"Theme Hospital path non-existent", L"Load Animations",
|
||||
wxOK | wxICON_ERROR, this);
|
||||
return;
|
||||
}
|
||||
|
@@ -52,14 +52,14 @@ end
|
||||
_G['corsixth'] = {}
|
||||
|
||||
--! Loads and runs a lua file.
|
||||
-- Similar to the built in require function with three important differenes:
|
||||
-- Similar to the built in require function with three important differences:
|
||||
-- * This function searches for --[[persistance: comments and maps the
|
||||
-- following function into the persistence table.
|
||||
-- * This function only searches in the Lua code directory
|
||||
-- * This function is only able to load lua source files (not C modules or
|
||||
-- compiled lua.
|
||||
--!param name (string)
|
||||
-- The name of the lua source file to run. Use dots to seperate directories,
|
||||
-- The name of the lua source file to run. Use dots to separate directories,
|
||||
-- and do not include the .lua file extension.
|
||||
--!return The return value of whatever source file is opened.
|
||||
corsixth.require = function(name)
|
||||
|
@@ -42,7 +42,7 @@ InterestRate is defined as centiprocent to allow for two decimals precision, i.e
|
||||
When a drug is researched, what effectiveness does it have
|
||||
#gbv.StartRating 80
|
||||
|
||||
The following table contains all diagnoses and treatments that shows up inthe drug casebook
|
||||
The following table contains all diagnoses and treatments that shows up in the drug casebook
|
||||
in the game. Known specifies whether it should show up from the beginning of the level and
|
||||
RschReqd how much research is required to discover the treatment room for the disease.
|
||||
#expertise[1].Known.RschReqd 1 0 GENERAL_PRACTICE
|
||||
|
@@ -66,7 +66,7 @@ How many patients still infected and not-cured cause the hospital to be evacuate
|
||||
When a drug is first researched, what effectiveness does it have
|
||||
#gbv.StartRating 80
|
||||
|
||||
The following table contains all diagnoses and treatments that shows up inthe drug casebook
|
||||
The following table contains all diagnoses and treatments that shows up in the drug casebook
|
||||
in the game. ContRate is whether this is contagious (lower the number the greater the chances of it appearing, 0 means never) and
|
||||
Known specifies whether it should show up from the beginning of the level and
|
||||
RschReqd how much research is required to discover the treatment room for the disease.
|
||||
|
@@ -20,7 +20,7 @@ SOFTWARE.
|
||||
|
||||
This file is used to ensure that the compiled binary being used by Lua is up
|
||||
to date. Without this system, if the binary was not recent enough, then the
|
||||
user would get a confusing error message along the lines of attemping to call
|
||||
user would get a confusing error message along the lines of attempting to call
|
||||
a nil value (as new API functions are nil in older binaries).
|
||||
|
||||
When a new API call is added to the C++ source, the version number in this
|
||||
|
@@ -1397,7 +1397,7 @@ end
|
||||
--! which save game version it is. This was added after the Beta 8
|
||||
--! release, which is why the checks prior to that version aren't made.
|
||||
--!param version An optional value if you want to find what game version
|
||||
-- a specific savegame verion is from.
|
||||
-- a specific savegame version is from.
|
||||
function App:getVersion(version)
|
||||
local ver = version or self.savegame_version
|
||||
if ver > 134 then
|
||||
@@ -1497,7 +1497,7 @@ function App:exit()
|
||||
self.running = false
|
||||
end
|
||||
|
||||
--! Exits the game completly without saving the config i.e. Alt+F4 for Quit Application
|
||||
--! Exits the game completely without saving the config i.e. Alt+F4 for Quit Application
|
||||
function App:abandon()
|
||||
self.running = false
|
||||
end
|
||||
|
@@ -536,7 +536,7 @@ end
|
||||
--! Does not affect the configuration setting play_music.
|
||||
function Audio:stopBackgroundTrack()
|
||||
if self.background_paused then
|
||||
-- unpause first in order to clear the backupped volume
|
||||
-- Resume first in order to clear the saved volume.
|
||||
self:pauseBackgroundTrack()
|
||||
end
|
||||
SDL.audio.stopMusic()
|
||||
|
@@ -211,7 +211,7 @@ local configuration = {
|
||||
{StartCost = 2500, StartAvail = 0, WhenAvail = 0, StartStrength = 8, AvailableForLevel = 0}, -- 9 Inflator Machine
|
||||
{StartCost = 150, StartAvail = 1, WhenAvail = 0, StartStrength = 10, AvailableForLevel = 1}, -- 10 Snooker Table
|
||||
{StartCost = 150, StartAvail = 1, WhenAvail = 0, StartStrength = 10, AvailableForLevel = 1}, -- 11 New Receptionists Station
|
||||
{StartCost = 5, StartAvail = 1, WhenAvail = 0, StartStrength = 10, AvailableForLevel = 1}, -- 12 Build Room Tressle Table
|
||||
{StartCost = 5, StartAvail = 1, WhenAvail = 0, StartStrength = 10, AvailableForLevel = 1}, -- 12 Build Room Trestle Table
|
||||
{StartCost = 1000, StartAvail = 0, WhenAvail = 0, StartStrength = 13, AvailableForLevel = 0}, -- 13 Cardiogram
|
||||
{StartCost = 5000, StartAvail = 0, WhenAvail = 0, StartStrength = 12, AvailableForLevel = 0}, -- 14 Scanner
|
||||
{StartCost = 3000, StartAvail = 1, WhenAvail = 0, StartStrength = 10, AvailableForLevel = 1}, -- 15 Scanner Console
|
||||
|
@@ -609,7 +609,7 @@ for key, value in pairs(hotkeys_defaults) do
|
||||
hotkeys_values[key] = serialize(value)
|
||||
end
|
||||
|
||||
-- If the file opened succesfully...
|
||||
-- If the file opened successfully...
|
||||
if fi then
|
||||
local file_contents = fi:read("*all")
|
||||
fi:close()
|
||||
@@ -634,7 +634,7 @@ end
|
||||
|
||||
--
|
||||
if hotkeys_needs_rewrite then
|
||||
-- The config file that will be written is divided into seperate strings, which are concatenated when they are written into the file.
|
||||
-- The config file that will be written is divided into separate strings, which are concatenated when they are written into the file.
|
||||
-- This is done to avoid a "Too many C levels" error.
|
||||
local string_01 = [=[
|
||||
--------------------------CorsixTH Hotkey Mappings File-------------------------
|
||||
|
@@ -707,7 +707,7 @@ function UIEditRoom:screenToWall(x, y)
|
||||
-- NB: Doors and windows cannot be placed on corner tiles, hence walls of corner tiles
|
||||
-- are never returned, and the nearest non-corner wall is returned instead. If they
|
||||
-- could be placed on corner tiles, then you would have to consider the interaction of
|
||||
-- wall shadows with windows and doors, amonst other things.
|
||||
-- wall shadows with windows and doors, amongst other things.
|
||||
-- Swing doors are allowed to be adjacent everywhere except the top corner.
|
||||
local modifier = 0
|
||||
local swinging = false
|
||||
@@ -1167,7 +1167,7 @@ end
|
||||
--! param wall (string) original wall orientation
|
||||
--! return x (int) updated x value
|
||||
--! return y (int) updated y value
|
||||
--! return x_mod (int) offest value to apply to tile count to determine relative position
|
||||
--! return x_mod (int) offset value to apply to tile count to determine relative position
|
||||
--! return y_mod (int) offset value to apply to tile count to determine relatitve position
|
||||
--! return wall (string) wall orientation style (only 2 styles)
|
||||
local function doorWallOffsetCalculations(x, y, wall)
|
||||
|
@@ -154,7 +154,7 @@ function UIProgressReport:drawMarkers(canvas, x, y)
|
||||
end
|
||||
|
||||
-- Possibly show warning that it's too cold, too hot, patients not happy
|
||||
-- or if theres need to build drink machines as folks are thirsty. Only show one at a time though!
|
||||
-- or if there's need to build drink machines as folks are thirsty. Only show one at a time though!
|
||||
-- TODO the levels may need adjustment
|
||||
local msg = self.ui.hospital.show_progress_screen_warnings
|
||||
if warmth < 0.3 and msg == 1 then
|
||||
|
@@ -48,7 +48,7 @@ function UIMenuBar:UIMenuBar(ui, map_editor)
|
||||
-- This should be present in self.open_menus, else it won't be drawn
|
||||
self.active_menu = false
|
||||
-- The list of menus which should be displayed
|
||||
-- This list satifies: open_menus[x] == nil or open_menus[x].level == x
|
||||
-- This list satisfies: open_menus[x] == nil or open_menus[x].level == x
|
||||
self.open_menus = {}
|
||||
|
||||
if map_editor then
|
||||
|
@@ -171,7 +171,7 @@ end
|
||||
|
||||
--[[ Before an epidemic has been revealed toggle the infected icons
|
||||
to easily distinguish the infected patients -- will toggle icons
|
||||
for ALL future epidemics you cannot distingush between epidemics
|
||||
for ALL future epidemics you cannot distinguish between epidemics
|
||||
by disease ]]
|
||||
function UICheats:cheatToggleInfected()
|
||||
local hospital = self.ui.hospital
|
||||
|
@@ -318,7 +318,7 @@ local function hotkey_input(hotkey, hotkey_buttons_table, app)
|
||||
Left for future patch.
|
||||
-- Disable the "global_exitApp" hotkey while assigning hotkeys?
|
||||
Even when "global_exitApp" isn't added at startup Alt+F4 still abandons program. Why?
|
||||
-- Modifier keys for other languages nessecary?
|
||||
-- Modifier keys for other languages necessary?
|
||||
-- Ex: STRG for german's "CTRL".
|
||||
]]
|
||||
|
||||
@@ -349,7 +349,7 @@ local function hotkey_input(hotkey, hotkey_buttons_table, app)
|
||||
hotkey == "ingame_scroll_down" or
|
||||
hotkey == "ingame_scroll_left" or
|
||||
hotkey == "ingame_scroll_right" then
|
||||
-- Get rid of any modifers, as they won't work correctly, anyway.
|
||||
-- Get rid of any modifiers, as they won't work correctly, anyway.
|
||||
noted_keys = remove_modifiers(noted_keys)
|
||||
end
|
||||
|
||||
|
@@ -18,7 +18,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE. --]]
|
||||
|
||||
--! Iterface for items within a UI tree control
|
||||
--! Interface for items within a UI tree control
|
||||
class "TreeNode"
|
||||
|
||||
---@type TreeNode
|
||||
|
@@ -688,9 +688,9 @@ end
|
||||
-- Helper function for the common case of instructing a `Humanoid` to walk to
|
||||
-- a position on the map. Equivalent to calling `setNextAction` with a walk
|
||||
-- action.
|
||||
--!param tile_x (integer) The X-component of the Lua tile co-ordinates of the
|
||||
--!param tile_x (integer) The X-component of the Lua tile coordinates of the
|
||||
-- tile to walk to.
|
||||
--!param tile_y (integer) The Y-component of the Lua tile co-ordinates of the
|
||||
--!param tile_y (integer) The Y-component of the Lua tile coordinates of the
|
||||
-- tile to walk to.
|
||||
--!param must_happen (boolean, nil) If true, then the walk action will not be
|
||||
-- interrupted.
|
||||
@@ -777,8 +777,8 @@ function Humanoid:tickDay()
|
||||
|
||||
-- If it is too hot or too cold, start to decrease happiness and
|
||||
-- show the corresponding icon. Otherwise we could get happier instead.
|
||||
local min_comfort_temp = 0.22 -- 11 degrees Celcius.
|
||||
local max_comfort_temp = 0.36 -- 18 degrees Celcius.
|
||||
local min_comfort_temp = 0.22 -- 11 degrees Celsius.
|
||||
local max_comfort_temp = 0.36 -- 18 degrees Celsius.
|
||||
local decrease_factor = 0.10
|
||||
local increase_happiness = 0.005
|
||||
|
||||
@@ -827,7 +827,7 @@ function Humanoid:unregisterRoomBuildCallback(callback)
|
||||
if self.build_callbacks[callback] then
|
||||
self.build_callbacks[callback] = nil
|
||||
else
|
||||
self.world:gameLog("Warning: Trying to remove nonexistant room build callback (" .. tostring(callback) .. ") from humanoid (" .. tostring(self) .. ").")
|
||||
self.world:gameLog("Warning: Trying to remove nonexistent room build callback (" .. tostring(callback) .. ") from humanoid (" .. tostring(self) .. ").")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -861,7 +861,7 @@ function Humanoid:unregisterRoomRemoveCallback(callback)
|
||||
self.world:unregisterRoomRemoveCallback(callback)
|
||||
self.remove_callbacks[callback] = nil
|
||||
else
|
||||
self.world:gameLog("Warning: Trying to remove nonexistant room remove callback (" .. tostring(callback) .. ") from humanoid (" .. tostring(self) .. ").")
|
||||
self.world:gameLog("Warning: Trying to remove nonexistent room remove callback (" .. tostring(callback) .. ") from humanoid (" .. tostring(self) .. ").")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -883,7 +883,7 @@ function Humanoid:unregisterStaffChangeCallback(callback)
|
||||
if self.staff_change_callbacks and self.staff_change_callbacks[callback] then
|
||||
self.staff_change_callbacks[callback] = nil
|
||||
else
|
||||
self.world:gameLog("Warning: Trying to remove nonexistant staff callback (" .. tostring(callback) .. ") from humanoid (" .. tostring(self) .. ").")
|
||||
self.world:gameLog("Warning: Trying to remove nonexistent staff callback (" .. tostring(callback) .. ") from humanoid (" .. tostring(self) .. ").")
|
||||
end
|
||||
end
|
||||
|
||||
|
@@ -622,7 +622,7 @@ function Patient:tickDay()
|
||||
end
|
||||
|
||||
-- Note: to avoid empty action queue error if the player spam clicks a patient at the same time as the day changes
|
||||
-- there is now an inbetween "neutal" stage.
|
||||
-- there is now an between "neutral" stage.
|
||||
if self.has_fallen == 3 then
|
||||
self.has_fallen = 1
|
||||
elseif self.has_fallen == 2 then
|
||||
|
@@ -528,7 +528,7 @@ function Staff:isIdle()
|
||||
return false
|
||||
end
|
||||
|
||||
-- Makes the staff member request a raise of 10%, or a wage exactly inbetween their current and a fair one, whichever is more.
|
||||
-- Makes the staff member request a raise of 10%, or a wage exactly in the middle of their current and a fair one, whichever is more.
|
||||
function Staff:requestRaise()
|
||||
-- Is this the first time a member of staff is requesting a raise?
|
||||
-- Only show the help if the player is playing the campaign though
|
||||
|
@@ -244,9 +244,9 @@ end
|
||||
|
||||
--! Get the primary tile which the object is attached to for rendering
|
||||
--[[! For objects which attach to a single tile for rendering, this method will
|
||||
return the X and Y Lua world co-ordinates of that tile. For objects which split
|
||||
return the X and Y Lua world coordinates of that tile. For objects which split
|
||||
their rendering over multiple tiles, one of them is arbitrarily designated as
|
||||
the primary tile, and its co-ordinates are returned.
|
||||
the primary tile, and its coordinates are returned.
|
||||
]]
|
||||
function Object:getRenderAttachTile()
|
||||
local x, y = self.tile_x, self.tile_y
|
||||
|
@@ -63,7 +63,7 @@ The silences between these sounds can either have randomly generated lengths bet
|
||||
they can all be a specified length by providing min and max tables with one value for the desired pause duration.
|
||||
|
||||
!param name_pattern (String) example: LAVA00*.WAV
|
||||
!param min_silence_lengths (table) the desired mininum silences length for the different tick rates, [3] = Normal
|
||||
!param min_silence_lengths (table) the desired minimum silences length for the different tick rates, [3] = Normal
|
||||
!param max_silence_lengths (table) the desired maximum silences length for the different tick rates, [3] = Normal
|
||||
!param num_silences (integer) how many different silence lengths should be used, this can be a nil parameter.
|
||||
-]]
|
||||
@@ -103,8 +103,8 @@ function Entity:setAnimation(animation, flags)
|
||||
end
|
||||
|
||||
--[[ Set the map tile which the entity is on.
|
||||
!param x (integer) The 1-based X co-ordinate of the tile.
|
||||
!param y (integer) The 1-based Y co-ordinate of the tile.
|
||||
!param x (integer) The 1-based X coordinate of the tile.
|
||||
!param y (integer) The 1-based Y coordinate of the tile.
|
||||
]]
|
||||
function Entity:setTile(x, y)
|
||||
if self.user_of then
|
||||
@@ -160,8 +160,8 @@ function Entity:setSpeed(x, y)
|
||||
end
|
||||
|
||||
--[[ Combined form of `setTile`, `setPosition`, and `setSpeed`
|
||||
!param tx (integer) The 1-based X co-ordinate of the tile.
|
||||
!param ty (integer) The 1-based Y co-ordinate of the tile.
|
||||
!param tx (integer) The 1-based X coordinate of the tile.
|
||||
!param ty (integer) The 1-based Y coordinate of the tile.
|
||||
!param px (integer) The 0-based X pixel offset from the default position.
|
||||
!param py (integer) The 0-based Y pixel offset from the default position.
|
||||
!param sx (integer) The X component of the speed in pixels per tick.
|
||||
@@ -359,7 +359,7 @@ function Entity:resetAnimation()
|
||||
end
|
||||
|
||||
--[[
|
||||
Returns the drawing layer for this particular entity. Should be overriden in derived classes. The drawing layer
|
||||
Returns the drawing layer for this particular entity. Should be overridden in derived classes. The drawing layer
|
||||
specifies the order in which object are drawn in a tile (the object with the smallest layer is drawn first).
|
||||
Litter should have layer 0, side objects to the north layer 1, side objects to the west layer 2,
|
||||
normal objects should have layers between 3 and 7, east side object should have layer 8 and south side
|
||||
|
@@ -829,7 +829,7 @@ function GameUI.limitPointToDiamond(dx, dy, visible_diamond, do_limit)
|
||||
if do_limit then
|
||||
-- Determine the quadrant which the point lies in and accordingly set:
|
||||
-- (vx, vy) : a unit vector perpendicular to the diamond edge in the quadrant
|
||||
-- (p1x, p1y), (p2x, p2y) : the two diamond verticies in the quadrant
|
||||
-- (p1x, p1y), (p2x, p2y) : the two diamond vertices in the quadrant
|
||||
-- d : distance from the point to the line defined by the diamond edge (not the line segment itself)
|
||||
local vx, vy, d
|
||||
local p1x, p1y, p2x, p2y = 0, 0, 0, 0
|
||||
@@ -1131,15 +1131,15 @@ function GameUI:startTutorial(chapter)
|
||||
self:tutorialStep(chapter, 0, 1)
|
||||
end
|
||||
|
||||
--! Converts centre of screen co-ordinates to world tile positions and stores the values for later recall
|
||||
-- param index (integer) Postion in recallpositions table
|
||||
--! Converts centre of screen coordinates to world tile positions and stores the values for later recall
|
||||
-- param index (integer) Position in recallpositions table
|
||||
function GameUI:setMapRecallPosition(index)
|
||||
local cx, cy = self:ScreenToWorld(self.app.config.width / 2, self.app.config.height / 2)
|
||||
self.recallpositions[index] = {x = cx, y = cy, z = self.zoom_factor}
|
||||
end
|
||||
|
||||
--! Retrives stored recall position and attempts to scroll to that position - will be limited to the bounds of the camera when zoomed out
|
||||
-- param index (integer) Postion in recallpositions table
|
||||
--! Retrieves stored recall position and attempts to scroll to that position - will be limited to the bounds of the camera when zoomed out
|
||||
-- param index (integer) Position in recallpositions table
|
||||
function GameUI:recallMapPosition(index)
|
||||
if self.recallpositions[index] ~= nil then
|
||||
local sx, sy = self.app.map:WorldToScreen(self.recallpositions[index].x, self.recallpositions[index].y)
|
||||
|
@@ -877,8 +877,8 @@ function Hospital:getHeliportSpawnPosition()
|
||||
end
|
||||
|
||||
--[[ Test if a given map tile is part of this hospital.
|
||||
!param x (integer) The 1-based X co-ordinate of the tile to test.
|
||||
!param y (integer) The 1-based Y co-ordinate of the tile to test.
|
||||
!param x (integer) The 1-based X coordinate of the tile to test.
|
||||
!param y (integer) The 1-based Y coordinate of the tile to test.
|
||||
]]
|
||||
function Hospital:isInHospital(x, y)
|
||||
local flags = self.world.map.th:getCellFlags(x, y)
|
||||
@@ -1824,7 +1824,7 @@ function Hospital:changeReputation(reason, disease, valueChange)
|
||||
if self.reputation_above_threshold then self:checkReputation() end
|
||||
end
|
||||
|
||||
--! Check whether the reputation is still above the treshold.
|
||||
--! Check whether the reputation is still above the threshold.
|
||||
function Hospital:checkReputation()
|
||||
local level_config = self.world.map.level_config
|
||||
if level_config.awards_trophies then
|
||||
|
@@ -70,7 +70,7 @@ local action_seek_room_find_room = permanent"action_seek_room_find_room"( functi
|
||||
return room
|
||||
else
|
||||
tried_rooms = tried_rooms + 1
|
||||
-- Remove the index of this room from the list of indeces available in available_diagnosis_rooms
|
||||
-- Remove the index of this room from the list of indices available in available_diagnosis_rooms
|
||||
table.remove(available_rooms, room_at_index)
|
||||
-- If the room can be built, set the flag for it.
|
||||
local diag = humanoid.world.available_rooms[room_type]
|
||||
|
@@ -104,10 +104,10 @@ function Map:registerTemperatureDisplayMethod()
|
||||
self.th:setTemperatureDisplay(self.temperature_display_method)
|
||||
end
|
||||
|
||||
-- Convert between world co-ordinates and screen co-ordinates
|
||||
-- World co-ordinates are (at least for standard maps) in the range [1, 128)
|
||||
-- Convert between world coordinates and screen coordinates
|
||||
-- World coordinates are (at least for standard maps) in the range [1, 128)
|
||||
-- for both x and y, with the floor of the values giving the cell index.
|
||||
-- Screen co-ordinates are pixels relative to the map origin - NOT relative to
|
||||
-- Screen coordinates are pixels relative to the map origin - NOT relative to
|
||||
-- the top-left corner of the screen (use UI:WorldToScreen and UI:ScreenToWorld
|
||||
-- for this).
|
||||
|
||||
|
@@ -30,7 +30,7 @@ object.idle_animations = {
|
||||
south = 2130,
|
||||
}
|
||||
-- There are five animations, for each the doctor and the handyman.
|
||||
-- The nurses don't like pool, appearently.
|
||||
-- The nurses don't like pool, apparently.
|
||||
--
|
||||
-- anim | doctor | handyman
|
||||
-- -----------------------------
|
||||
|
@@ -216,7 +216,7 @@ end
|
||||
--[[ Create orders for the specified receptionist to walk to and then staff the reception desk,
|
||||
if not already staffed or someone is on the way
|
||||
!param receptionist (Staff) the receptionist to occupy this desk
|
||||
!return true iff the receptionist was ordered to the desk
|
||||
!return true if the receptionist was ordered to the desk
|
||||
]]
|
||||
function ReceptionDesk:occupy(receptionist)
|
||||
if not self.receptionist and not self.reserved_for then
|
||||
|
@@ -95,7 +95,7 @@ end
|
||||
--! For a true patient queue count, use Queue:reportedSize.
|
||||
--!return (int) Number of various people in the queue.
|
||||
function Queue:size()
|
||||
-- Rememeber, the size includes people waiting to leave and staff waiting to enter
|
||||
-- Remember, the size includes people waiting to leave and staff waiting to enter
|
||||
-- For just the patients waiting to enter, use Queue:reportedSize()
|
||||
-- Most of the time, size() == reportedSize(), so it won't be immediately obvious
|
||||
-- if you're using the wrong method, but from time to time, staff or exiting
|
||||
|
@@ -144,7 +144,7 @@ function Room:getPatientCount()
|
||||
end
|
||||
|
||||
-- function that sets a given attribute to a given value for all staff members.
|
||||
-- Should be overriden for rooms that have more than one staff member.
|
||||
-- Should be overridden for rooms that have more than one staff member.
|
||||
function Room:setStaffMembersAttribute(attribute, value)
|
||||
if self.staff_member then
|
||||
self.staff_member[attribute] = value
|
||||
|
@@ -18,7 +18,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE. --]]
|
||||
|
||||
-- Force local variables to be used for everything (except for explicity
|
||||
-- Force local variables to be used for everything (except for explicitly
|
||||
-- declared variables and any code running in derestriced mode). This helps to
|
||||
-- catch typos in variable names, and promotes usage of locals over globals
|
||||
-- (which improves speed).
|
||||
|
@@ -66,7 +66,7 @@ function Strings:init()
|
||||
self.chunk_to_names = {}
|
||||
for chunk, filename in pairs(self.language_chunks) do
|
||||
-- To allow the file to set global variables without causing an error, it
|
||||
-- is given an infinite table as an environment. Reading a non-existant
|
||||
-- is given an infinite table as an environment. Reading a non-existent
|
||||
-- key from an infinite table returns another infinite table, rather than
|
||||
-- the default value of nil.
|
||||
local infinite_table_mt
|
||||
@@ -127,7 +127,7 @@ end
|
||||
local shadows = setmetatable({}, {__mode = "k"})
|
||||
|
||||
-- Metatable which is used for all tables returned by Strings:load()
|
||||
-- The end effect is to raise errors on accesses to non-existant strings
|
||||
-- The end effect is to raise errors on accesses to non-existent strings
|
||||
-- (unless no_restriction is set to true), to add a special string called
|
||||
-- "__random" to each table (which always resolves to a random string from
|
||||
-- the table), and to prevent editing or adding to a string table.
|
||||
@@ -140,7 +140,7 @@ local strings_metatable = function(no_restriction) return {
|
||||
end
|
||||
if key ~= "__random" then
|
||||
if no_restriction then return nil end
|
||||
error("Non-existant string: " .. tostring(key), 2)
|
||||
error("Non-existent string: " .. tostring(key), 2)
|
||||
end
|
||||
local candidates = {}
|
||||
for _, v in pairs(t) do
|
||||
@@ -159,7 +159,7 @@ local strings_metatable = function(no_restriction) return {
|
||||
end,
|
||||
} end
|
||||
|
||||
-- no_restriction disables errors on access to non-existant strings (for debug purposes)
|
||||
-- no_restriction disables errors on access to non-existent strings (for debug purposes)
|
||||
-- no_inheritance disables inheritance except original_strings (for debug purposes)
|
||||
function Strings:load(language, no_restriction, no_inheritance)
|
||||
assert(language ~= "original_strings", "Original strings can not be loaded directly. Please select a proper language.")
|
||||
@@ -191,7 +191,7 @@ function Strings:load(language, no_restriction, no_inheritance)
|
||||
end,
|
||||
ipairs = ipairs,
|
||||
pairs = pairs,
|
||||
-- Calling the Langauage() function should have no effect any more
|
||||
-- Calling the Language() function should have no effect any more
|
||||
Language = function()
|
||||
language_called = true
|
||||
end,
|
||||
|
@@ -360,7 +360,7 @@ end
|
||||
-- pressed.
|
||||
--!param ... Additional arguments to `callback`.
|
||||
function UI:addKeyHandler(keys, window, callback, ...)
|
||||
-- It is nessecary to clone the key table into another temporary table, as if we don't the original table that we take it from will lose
|
||||
-- It is necessary to clone the key table into another temporary table, as if we don't the original table that we take it from will lose
|
||||
-- the last key of that table permenently in the next line of code after this one, until the program is restarted.
|
||||
-- I.E. if the "ingame_quitLevel" hotkey from the "hotkeys_values" table in "config_finder.lua" is a table that looks like this:
|
||||
-- {"shift", "q"}
|
||||
@@ -379,7 +379,7 @@ function UI:addKeyHandler(keys, window, callback, ...)
|
||||
if type(keys) == "string" then
|
||||
print(string.format("\"%s\" does not exist in the hotkeys configuration file.", keys))
|
||||
else
|
||||
print("Useage of addKeyHandler() requires the first argument to be a string of a key that can be found in the hotkeys configuration file.")
|
||||
print("Usage of addKeyHandler() requires the first argument to be a string of a key that can be found in the hotkeys configuration file.")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -475,7 +475,7 @@ function UI:removeKeyHandler(keys, window)
|
||||
if type(keys) == "string" then
|
||||
print(string.format("\"%s\" does not exist in the \"ui.key_handlers\" table.", keys))
|
||||
else
|
||||
print("Useage of removeKeyHandler() requires the first argument to be a string of a key that can be found in the \"ui.key_handlers\" table.")
|
||||
print("Usage of removeKeyHandler() requires the first argument to be a string of a key that can be found in the \"ui.key_handlers\" table.")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1106,7 +1106,7 @@ function UI:makeScreenshot()
|
||||
end
|
||||
|
||||
--! Closes one window (the topmost / active window, if possible)
|
||||
--!return true iff a window was closed
|
||||
--!return true if a window was closed
|
||||
function UI:closeWindow()
|
||||
if not self.windows then
|
||||
return false
|
||||
|
@@ -277,14 +277,14 @@ function hasBit(value, bit)
|
||||
end
|
||||
|
||||
--! Convert an array table to a string.
|
||||
--! Joins each elements by the provided seperator. As a convenience feature
|
||||
--! Joins each elements by the provided separator. As a convenience feature
|
||||
--! if the input is not an array it will be converted to a string and
|
||||
--! returned.
|
||||
--!param array (table) array to join.
|
||||
--!param seperator (string) seperator between elements.
|
||||
--!param separator (string) separator between elements.
|
||||
--!return (string) The joined string.
|
||||
function array_join(array, seperator)
|
||||
seperator = seperator or ","
|
||||
function array_join(array, separator)
|
||||
separator = separator or ","
|
||||
|
||||
if type(array) ~= "table" then
|
||||
return tostring(array)
|
||||
@@ -297,7 +297,7 @@ function array_join(array, seperator)
|
||||
local result = tostring(array[1])
|
||||
local i = 2
|
||||
while array[i] ~= nil do
|
||||
result = result .. seperator
|
||||
result = result .. separator
|
||||
result = result .. tostring(array[i])
|
||||
i = i + 1
|
||||
end
|
||||
|
@@ -740,8 +740,8 @@ end
|
||||
|
||||
--[[ Convert a static panel into a clickable button.
|
||||
!param panel (Panel) The panel to convert into a button.
|
||||
!param x (integer) The X co-ordinate of the clickable rectangle on the panel.
|
||||
!param y (integer) The Y co-ordinate of the clickable rectangle on the panel.
|
||||
!param x (integer) The X coordinate of the clickable rectangle on the panel.
|
||||
!param y (integer) The Y coordinate of the clickable rectangle on the panel.
|
||||
!param w (integer) The width of the clickable rectangle on the panel.
|
||||
!param h (integer) The height of the clickable rectangle on the panel.
|
||||
!param sprite (integer) An index into the window's sprite sheet. The panel will
|
||||
@@ -1524,9 +1524,9 @@ function Window:hitTestPanel(x, y, panel)
|
||||
end
|
||||
|
||||
--[[ Used to test if the window has a (non-transparent) pixel at the given position.
|
||||
!param x (integer) The X co-ordinate of the pixel to test, relative to the
|
||||
!param x (integer) The X coordinate of the pixel to test, relative to the
|
||||
top-left corner of the window.
|
||||
!param y (integer) The Y co-ordinate of the pixel to test, relative to the
|
||||
!param y (integer) The Y coordinate of the pixel to test, relative to the
|
||||
top-left corner of the window.
|
||||
]]
|
||||
function Window:hitTest(x, y)
|
||||
@@ -1744,9 +1744,9 @@ function Window:beginDrag(x, y)
|
||||
end
|
||||
|
||||
--[[ Called when the user moves the mouse.
|
||||
!param x (integer) The new X co-ordinate of the cursor, relative to the top-left
|
||||
!param x (integer) The new X coordinate of the cursor, relative to the top-left
|
||||
corner of the window.
|
||||
!param y (integer) The new Y co-ordinate of the cursor, relative to the top-left
|
||||
!param y (integer) The new Y coordinate of the cursor, relative to the top-left
|
||||
corner of the window.
|
||||
!param dx (integer) The number of pixels which the cursor moved horizontally.
|
||||
!param dy (integer) The number of pixels which the cursor moved vertically.
|
||||
@@ -1925,12 +1925,12 @@ end
|
||||
--! Create a static (non-changeable) tooltip to be displayed in a certain region.
|
||||
--! tooltip_x and tooltip_y are optional; if not specified, it will default to top center of region.
|
||||
--!param text (string) The string to display.
|
||||
--!param x (integer) The X co-ordinate relative to the top-left corner.
|
||||
--!param y (integer) The Y co-ordinate relative to the top-left corner.
|
||||
--!param r (integer) The right (X + width) co-ordinate relative to the top-left corner.
|
||||
--!param b (integer) The bottom (Y + height) co-ordinate relative to the top-left corner.
|
||||
--!param tooltip_x (integer) [optional] The X co-ordinate to display the tooltip at.
|
||||
--!param tooltip_y (integer) [optional] The Y co-ordinate to display the tooltip at.
|
||||
--!param x (integer) The X coordinate relative to the top-left corner.
|
||||
--!param y (integer) The Y coordinate relative to the top-left corner.
|
||||
--!param r (integer) The right (X + width) coordinate relative to the top-left corner.
|
||||
--!param b (integer) The bottom (Y + height) coordinate relative to the top-left corner.
|
||||
--!param tooltip_x (integer) [optional] The X coordinate to display the tooltip at.
|
||||
--!param tooltip_y (integer) [optional] The Y coordinate to display the tooltip at.
|
||||
function Window:makeTooltip(text, x, y, r, b, tooltip_x, tooltip_y)
|
||||
local region = {
|
||||
text = text, x = x, y = y, r = r, b = b,
|
||||
@@ -1944,12 +1944,12 @@ end
|
||||
--! Create a dynamic tooltip to be displayed in a certain region.
|
||||
--! tooltip_x and tooltip_y are optional; if not specified, it will default to top center of region.
|
||||
--!param callback (function) A function that returns the string to display or nil for no tooltip.
|
||||
--!param x (integer) The X co-ordinate relative to the top-left corner.
|
||||
--!param y (integer) The Y co-ordinate relative to the top-left corner.
|
||||
--!param r (integer) The right (X + width) co-ordinate relative to the top-left corner.
|
||||
--!param b (integer) The bottom (Y + height) co-ordinate relative to the top-left corner.
|
||||
--!param tooltip_x (integer) [optional] The X co-ordinate to display the tooltip at.
|
||||
--!param tooltip_y (integer) [optional] The Y co-ordinate to display the tooltip at.
|
||||
--!param x (integer) The X coordinate relative to the top-left corner.
|
||||
--!param y (integer) The Y coordinate relative to the top-left corner.
|
||||
--!param r (integer) The right (X + width) coordinate relative to the top-left corner.
|
||||
--!param b (integer) The bottom (Y + height) coordinate relative to the top-left corner.
|
||||
--!param tooltip_x (integer) [optional] The X coordinate to display the tooltip at.
|
||||
--!param tooltip_y (integer) [optional] The Y coordinate to display the tooltip at.
|
||||
function Window:makeDynamicTooltip(callback, x, y, r, b, tooltip_x, tooltip_y)
|
||||
local region = {
|
||||
callback = callback, x = x, y = y, r = r, b = b,
|
||||
@@ -1981,8 +1981,8 @@ end
|
||||
-- (see Button:setTooltip, Panel:setTooltip, Window:make[Dynamic]Tooltip)
|
||||
--! Button tooltips take precedence over region tooltips, which again take precedence over panels.
|
||||
-- Returns tooltip in form of { text = .. , x = .. , y = .. } or nil for no tooltip.
|
||||
--!param x (integer) The X co-ordinate relative to the top-left corner.
|
||||
--!param y (integer) The Y co-ordinate relative to the top-left corner.
|
||||
--!param x (integer) The X coordinate relative to the top-left corner.
|
||||
--!param y (integer) The Y coordinate relative to the top-left corner.
|
||||
function Window:getTooltipAt(x, y)
|
||||
if x < 0 or y < 0 or (self.width and x >= self.width) or (self.height and y >= self.height) then
|
||||
return
|
||||
|
@@ -812,7 +812,7 @@ function World:notifyRoomRemoved(room)
|
||||
end
|
||||
end
|
||||
|
||||
--! Clear all internal caches which are dependant upon map state / object position
|
||||
--! Clear all internal caches which are dependent upon map state / object position
|
||||
function World:clearCaches()
|
||||
self.idle_cache = {}
|
||||
end
|
||||
|
@@ -178,7 +178,7 @@ describe("Date", function()
|
||||
it("can provide hours per day", function()
|
||||
assert.equals(50, Date.hoursPerDay())
|
||||
end)
|
||||
it("can chack if two days are the same", function()
|
||||
it("can check if two days are the same", function()
|
||||
assert.True(Date(1,2,3,5):isSameDay(Date(1,2,3,9)))
|
||||
assert.False(Date(1,2,3):isSameDay(Date(1,4,3)))
|
||||
end)
|
||||
|
@@ -11,7 +11,7 @@ describe("serialize", function()
|
||||
assert.equal('[=[he]]o]=]', res)
|
||||
end)
|
||||
|
||||
it("serializes an array of primatives", function()
|
||||
it("serializes an array of primitives", function()
|
||||
local res = serialize({'hello', 'happy', 'people', 'everywhere', 42, false})
|
||||
assert.equal('{[[hello]],[[happy]],[[people]],[[everywhere]],42,false}', res)
|
||||
end)
|
||||
@@ -92,12 +92,12 @@ describe("serialize", function()
|
||||
end)
|
||||
|
||||
describe("array_join", function()
|
||||
it("joins a basic array of numbers to a comma seperated string", function()
|
||||
it("joins a basic array of numbers to a comma separated string", function()
|
||||
local res = array_join({5,3,1,0})
|
||||
assert.equals("5,3,1,0", res)
|
||||
end)
|
||||
|
||||
it("joins a string array with custom seperator", function()
|
||||
it("joins a string array with custom separator", function()
|
||||
local res = array_join({"a"," long"," hard","able"}," very")
|
||||
assert.equals("a very long very hard veryable", res)
|
||||
end)
|
||||
|
@@ -71,7 +71,7 @@ constexpr ptrdiff_t filename_length_offset = 32;
|
||||
/// from the start of the file entry.
|
||||
constexpr ptrdiff_t filename_offset = 33;
|
||||
|
||||
/// The minimium valid size of a valid file entry.
|
||||
/// The minimum valid size of a valid file entry.
|
||||
/// Accounts for all fixed header value offsets and even number padding.
|
||||
constexpr uint8_t minimum_file_entry_size = 34;
|
||||
|
||||
|
@@ -141,7 +141,7 @@ class iso_filesystem {
|
||||
//! Build the list of Theme Hospital data files
|
||||
/*!
|
||||
\param iSector The ordinal of a logical sector containing a padded
|
||||
arrary of ISO 9660 directory entries.
|
||||
array of ISO 9660 directory entries.
|
||||
\param iDirEntsSize The number of bytes in the directory entry array.
|
||||
\param prefix The path name to prepend to filenames in the directory.
|
||||
*/
|
||||
|
@@ -80,7 +80,7 @@ int lua_main_no_eval(lua_State* L) {
|
||||
preload_lua_package(L, "persist", luaopen_persist);
|
||||
preload_lua_package(L, "sdl", luaopen_sdl);
|
||||
|
||||
// require "debug" (Harmless in Lua 5.1, useful in 5.2 for compatbility)
|
||||
// require "debug" (Harmless in Lua 5.1, useful in 5.2 for compatibility)
|
||||
luaT_execute(L, "require \"debug\"");
|
||||
|
||||
// Check for --interpreter and run that instead of CorsixTH.lua
|
||||
|
@@ -1274,8 +1274,8 @@ int l_persist_dofile(lua_State* L) {
|
||||
lua_settable(L, luaT_upvalueindex(2));
|
||||
} else {
|
||||
return luaL_error(L,
|
||||
"Multiple persistable functions defin"
|
||||
"ed on the same line (%s:%d)",
|
||||
"Multiple persistable functions defined"
|
||||
"on the same line (%s:%d)",
|
||||
sFilename, iLineNumber);
|
||||
}
|
||||
|
||||
|
@@ -57,7 +57,7 @@ class lua_persist_writer {
|
||||
virtual void fast_write_stack_object(int iIndex) = 0;
|
||||
|
||||
// Writes an unsigned integer as a variable number of bytes
|
||||
// Endian independant and underlying type size independant
|
||||
// Endian independent and underlying type size independent
|
||||
template <class T>
|
||||
void write_uint(T tValue) {
|
||||
T tTemp(tValue);
|
||||
|
@@ -273,7 +273,7 @@ class animation_manager {
|
||||
*/
|
||||
bool load_custom_animations(const uint8_t* pData, size_t iDataLength);
|
||||
|
||||
//! Get the total numer of animations
|
||||
//! Get the total number of animations
|
||||
size_t get_animation_count() const;
|
||||
|
||||
//! Get the total number of animation frames
|
||||
|
@@ -27,7 +27,7 @@ SOFTWARE.
|
||||
namespace {
|
||||
|
||||
/* this variable is used to determine the layer of the animation, it should be
|
||||
rewriten at some
|
||||
rewritten at some
|
||||
point so that the it is passed as an argument in the function l_anim_set_tile
|
||||
*/
|
||||
int last_layer = 2;
|
||||
|
@@ -118,7 +118,7 @@ class lua_class_binding final {
|
||||
*
|
||||
* @param pState The lua environment to bind to.
|
||||
* @param name The name to give this lua 'class'.
|
||||
* @param new_fn The fuction to call when a new class is created.
|
||||
* @param new_fn The function to call when a new class is created.
|
||||
* @param mt The metatable id for the class
|
||||
*/
|
||||
lua_class_binding(const lua_register_state* pState, const char* name,
|
||||
|
@@ -449,7 +449,7 @@ int l_map_getcell(lua_State* L) {
|
||||
if (pNode == nullptr) {
|
||||
return luaL_argerror(L, 2,
|
||||
lua_pushfstring(L,
|
||||
"Map co-ordinates out "
|
||||
"Map coordinates out "
|
||||
"of bounds (%d, %d)",
|
||||
iX + 1, iY + 1));
|
||||
}
|
||||
@@ -527,7 +527,7 @@ int l_map_getcellflags(lua_State* L) {
|
||||
int iY = static_cast<int>(luaL_checkinteger(L, 3) - 1); // the map does too.
|
||||
map_tile* pNode = pMap->get_tile(iX, iY);
|
||||
if (pNode == nullptr) {
|
||||
return luaL_argerror(L, 2, "Map co-ordinates out of bounds");
|
||||
return luaL_argerror(L, 2, "Map coordinates out of bounds");
|
||||
}
|
||||
if (lua_type(L, 4) != LUA_TTABLE) {
|
||||
lua_settop(L, 3);
|
||||
@@ -561,7 +561,7 @@ int l_map_erase_thobs(lua_State* L) {
|
||||
int iY = static_cast<int>(luaL_checkinteger(L, 3) - 1); // the map does too.
|
||||
map_tile* pNode = pMap->get_tile(iX, iY);
|
||||
if (pNode == nullptr) {
|
||||
return luaL_argerror(L, 2, "Map co-ordinates out of bounds");
|
||||
return luaL_argerror(L, 2, "Map coordinates out of bounds");
|
||||
}
|
||||
pNode->objects.clear();
|
||||
return 1;
|
||||
@@ -574,7 +574,7 @@ int l_map_remove_cell_thob(lua_State* L) {
|
||||
int iY = static_cast<int>(luaL_checkinteger(L, 3) - 1); // the map does too.
|
||||
map_tile* pNode = pMap->get_tile(iX, iY);
|
||||
if (pNode == nullptr) {
|
||||
return luaL_argerror(L, 2, "Map co-ordinates out of bounds");
|
||||
return luaL_argerror(L, 2, "Map coordinates out of bounds");
|
||||
}
|
||||
auto thob = static_cast<object_type>(luaL_checkinteger(L, 4));
|
||||
for (auto iter = pNode->objects.begin(); iter != pNode->objects.end();
|
||||
@@ -594,7 +594,7 @@ int l_map_setcellflags(lua_State* L) {
|
||||
int iY = static_cast<int>(luaL_checkinteger(L, 3) - 1); // the map does too.
|
||||
map_tile* pNode = pMap->get_tile(iX, iY);
|
||||
if (pNode == nullptr) {
|
||||
return luaL_argerror(L, 2, "Map co-ordinates out of bounds");
|
||||
return luaL_argerror(L, 2, "Map coordinates out of bounds");
|
||||
}
|
||||
luaL_checktype(L, 4, LUA_TTABLE);
|
||||
lua_settop(L, 4);
|
||||
@@ -642,7 +642,7 @@ int l_map_setcell(lua_State* L) {
|
||||
int iY = static_cast<int>(luaL_checkinteger(L, 3) - 1); // the map does too.
|
||||
map_tile* pNode = pMap->get_tile(iX, iY);
|
||||
if (pNode == nullptr) {
|
||||
return luaL_argerror(L, 2, "Map co-ordinates out of bounds");
|
||||
return luaL_argerror(L, 2, "Map coordinates out of bounds");
|
||||
}
|
||||
if (lua_gettop(L) >= 7) {
|
||||
pNode->iBlock[0] = (uint16_t)luaL_checkinteger(L, 4);
|
||||
|
@@ -957,12 +957,12 @@ void level_map::draw(render_target* pCanvas, int iScreenX, int iScreenY,
|
||||
int iCanvasY) const {
|
||||
/*
|
||||
The map is drawn in two passes, with each pass done one scanline at a
|
||||
time (a scanline is a list of tiles with the same screen Y co-ordinate).
|
||||
time (a scanline is a list of tiles with the same screen Y coordinate).
|
||||
The first pass does floor tiles, as the entire floor needs to be painted
|
||||
below anything else (for example, see the walking north through a door
|
||||
animation, which needs to paint over the floor of the scanline below the
|
||||
animation). On the second pass, walls and entities are drawn, with the
|
||||
order controlled such that entites appear in the right order relative to
|
||||
order controlled such that entities appear in the right order relative to
|
||||
the walls around them. For each scanline, the following is done:
|
||||
|
||||
1st pass:
|
||||
@@ -1053,7 +1053,7 @@ void level_map::draw(render_target* pCanvas, int iScreenX, int iScreenY,
|
||||
if (!bFirst) {
|
||||
// since the scanline count from one THMapScanlineIterator to
|
||||
// another can differ synchronization between the current iterator
|
||||
// and the former one is neeeded
|
||||
// and the former one is needed
|
||||
if (itrNode.x() < -64) {
|
||||
++itrNode;
|
||||
}
|
||||
|
@@ -331,24 +331,24 @@ class level_map {
|
||||
/*!
|
||||
Draws the world pixel rectangle (iScreenX, iScreenY, iWidth, iHeight)
|
||||
to the rectangle (iCanvasX, iCanvasY, iWidth, iHeight) on pCanvas. Note
|
||||
that world pixel co-ordinates are also known as absolute screen
|
||||
co-ordinates - they are not world (tile) co-ordinates, nor (relative)
|
||||
screen co-ordinates.
|
||||
that world pixel coordinates are also known as absolute screen
|
||||
coordinates - they are not world (tile) coordinates, nor (relative)
|
||||
screen coordinates.
|
||||
*/
|
||||
void draw(render_target* pCanvas, int iScreenX, int iScreenY, int iWidth,
|
||||
int iHeight, int iCanvasX, int iCanvasY) const;
|
||||
|
||||
//! Perform a hit-test against the animations attached to the map
|
||||
/*!
|
||||
If there is an animation at world pixel co-ordinates (iTestX, iTestY),
|
||||
If there is an animation at world pixel coordinates (iTestX, iTestY),
|
||||
then it is returned. Otherwise nullptr is returned.
|
||||
To perform a hit-test using world (tile) co-ordinates, get the tile
|
||||
To perform a hit-test using world (tile) coordinates, get the tile
|
||||
itself and query the top 8 bits of map_tile::flags, or traverse the
|
||||
tile's animation lists.
|
||||
*/
|
||||
drawable* hit_test(int iTestX, int iTestY) const;
|
||||
|
||||
// When using the unchecked versions, the map co-ordinates MUST be valid.
|
||||
// When using the unchecked versions, the map coordinates MUST be valid.
|
||||
// When using the normal versions, nullptr is returned for invalid co-ords.
|
||||
map_tile* get_tile(int iX, int iY);
|
||||
const map_tile* get_tile(int iX, int iY) const;
|
||||
@@ -360,7 +360,7 @@ class level_map {
|
||||
uint16_t get_tile_temperature(const map_tile* pNode) const;
|
||||
int get_tile_owner(const map_tile* pNode) const;
|
||||
|
||||
//! Convert world (tile) co-ordinates to absolute screen co-ordinates
|
||||
//! Convert world (tile) coordinates to absolute screen coordinates
|
||||
template <typename T>
|
||||
static inline void world_to_screen(T& x, T& y) {
|
||||
T x_(x);
|
||||
@@ -368,7 +368,7 @@ class level_map {
|
||||
y = (T)16 * (x_ + y);
|
||||
}
|
||||
|
||||
//! Convert absolute screen co-ordinates to world (tile) co-ordinates
|
||||
//! Convert absolute screen coordinates to world (tile) coordinates
|
||||
template <typename T>
|
||||
static inline void screen_to_world(T& x, T& y) {
|
||||
T x_(x);
|
||||
@@ -460,9 +460,9 @@ class map_tile_iterator {
|
||||
|
||||
/*!
|
||||
@arg pMap The map whose tiles should be iterated
|
||||
@arg iScreenX The X co-ordinate of the top-left corner of the
|
||||
@arg iScreenX The X coordinate of the top-left corner of the
|
||||
screen-space rectangle to iterate.
|
||||
@arg iScreenY The Y co-ordinate of the top-left corner of the
|
||||
@arg iScreenY The Y coordinate of the top-left corner of the
|
||||
screen-space rectangle to iterate.
|
||||
@arg iWidth The width of the screen-space rectangle to iterate.
|
||||
@arg iHeight The width of the screen-space rectangle to iterate.
|
||||
@@ -474,7 +474,7 @@ class map_tile_iterator {
|
||||
map_scanline_iterator_direction eScanlineDirection =
|
||||
map_scanline_iterator_direction::forward);
|
||||
|
||||
//! Returns false iff the iterator has exhausted its tiles
|
||||
//! Returns false if the iterator has exhausted its tiles
|
||||
inline operator bool() const { return tile != nullptr; }
|
||||
|
||||
//! Advances the iterator to the next tile
|
||||
@@ -501,7 +501,7 @@ class map_tile_iterator {
|
||||
return (static_cast<int>(direction) - 1) * (1 - container->get_width());
|
||||
}
|
||||
|
||||
//! Returns true iff the next tile will be on a different scanline
|
||||
//! Returns true if the next tile will be on a different scanline
|
||||
/*!
|
||||
To visit a scanline in right-to-left order, or to revisit a scanline,
|
||||
wait until this method returns true, then use a THMapScanlineIterator.
|
||||
|
@@ -60,7 +60,7 @@ struct path_node {
|
||||
|
||||
//! Minimum distance from this cell to the goal
|
||||
/*!
|
||||
Value is only dependant upon the cell position and the goal
|
||||
Value is only dependent upon the cell position and the goal
|
||||
position, and is undefined if not part of a path.
|
||||
*/
|
||||
int guess;
|
||||
|
@@ -43,7 +43,7 @@ class sound_archive {
|
||||
//! Gets the name of the sound at a given index
|
||||
const char* get_sound_name(size_t iIndex) const;
|
||||
|
||||
//! Gets the duration (in miliseconds) of the sound at a given index
|
||||
//! Gets the duration (in milliseconds) of the sound at a given index
|
||||
size_t get_sound_duration(size_t iIndex);
|
||||
|
||||
//! Opens the sound at a given index into an SDL_RWops structure
|
||||
|
@@ -32,7 +32,7 @@ local tokens = P { "tokens";
|
||||
-- Single line comment
|
||||
line_comment = Ct(P"//" * C((1 - V"newline")^0) * Cc"comment_line"),
|
||||
|
||||
-- Single platform independant line break which increments line number
|
||||
-- Single platform independent line break which increments line number
|
||||
newline = (P"\r\n" + P"\n\r" + S"\r\n") * (Cp() * Carg(1)) / function(pos, state)
|
||||
state.line = state.line + 1
|
||||
state.line_start = pos
|
||||
|
@@ -46,7 +46,7 @@ local identifier_type = {
|
||||
["true"] = "constant",
|
||||
["until"] = "keyword",
|
||||
["while"] = "keyword",
|
||||
-- everything else is "identifer"
|
||||
-- everything else is "identifier"
|
||||
}
|
||||
|
||||
local tokens = P { "tokens";
|
||||
@@ -56,7 +56,7 @@ local tokens = P { "tokens";
|
||||
file_start = Ct(C(P"#" * (1 - S"\r\n")^0) * Cc"comment"),
|
||||
utf8_bom = P"\239\187\191",
|
||||
|
||||
-- Single platform independant line break which increments line number
|
||||
-- Single platform independent line break which increments line number
|
||||
newline = (P"\r\n" + P"\n\r" + S"\r\n") * (Cp() * Carg(1)) / function(pos, state)
|
||||
state.line = state.line + 1
|
||||
state.line_start = pos
|
||||
|
@@ -14,7 +14,7 @@
|
||||
; misrepresented as being the original software.
|
||||
; 3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
; Replaces all ocurrences of a given needle within a haystack with another string
|
||||
; Replaces all occurrences of a given needle within a haystack with another string
|
||||
; Written by dandaman32
|
||||
|
||||
Var STR_REPLACE_VAR_0
|
||||
|
Reference in New Issue
Block a user