#ifndef AP_STATE_H_664A4180 #define AP_STATE_H_664A4180 #include #include #include #include #include #include "game_data.h" class TrackerFrame; enum DoorShuffleMode { kNO_DOORS = 0, kPANELS_MODE = 1, kDOORS_MODE = 2 }; enum VictoryCondition { kTHE_END = 0, kTHE_MASTER = 1, kLEVEL_2 = 2, kPILGRIMAGE = 3 }; enum LocationChecks { kNORMAL_LOCATIONS = 0, kREDUCED_LOCATIONS = 1, kPANELSANITY = 2 }; enum SunwarpAccess { kSUNWARP_ACCESS_NORMAL = 0, kSUNWARP_ACCESS_DISABLED = 1, kSUNWARP_ACCESS_UNLOCK = 2, kSUNWARP_ACCESS_INDIVIDUAL = 3, kSUNWARP_ACCESS_PROGRESSIVE = 4 }; struct SunwarpMapping { int dots; int exit_index; }; void AP_SetTrackerFrame(TrackerFrame* tracker_frame); void AP_Connect(std::string server, std::string player, std::string password); std::string AP_GetStatusMessage(); std::string AP_GetSaveName(); bool AP_HasCheckedGameLocation(int location_id); bool AP_HasCheckedHuntPanel(int location_id); // This doesn't lock the state mutex, for speed, so it must ONLY be called from // RecalculateReachability, which is only called from the APState thread anyway. bool AP_HasItem(int item_id, int quantity = 1); // This doesn't lock the client mutex because it is ONLY to be called from // RecalculateReachability, which is only called from within a client callback // anyway. std::string AP_GetItemName(int item_id); DoorShuffleMode AP_GetDoorShuffleMode(); bool AP_AreDoorsGrouped(); bool AP_IsColorShuffle(); bool AP_IsPaintingShuffle(); std::map AP_GetPaintingMapping(); bool AP_IsPaintingMappedTo(const std::string& painting_id); std::set AP_GetCheckedPaintings(); bool AP_IsPaintingChecked(const std::string& painting_id); int AP_GetMasteryRequirement(); int AP_GetLevel2Requirement(); bool AP_IsLocationVisible(int classification); VictoryCondition AP_GetVictoryCondition(); bool AP_HasAchievement(const std::string& achievement_name); bool AP_HasEarlyColorHallways(); bool AP_IsPilgrimageEnabled(); bool AP_DoesPilgrimageAllowRoofAccess(); bool AP_DoesPilgrimageAllowPaintings(); SunwarpAccess AP_GetSunwarpAccess(); bool AP_IsSunwarpShuffle(); std::map AP_GetSunwarpMapping(); bool AP_HasReachedGoal(); std::optional> AP_GetPlayerPosition(); #endif /* end of include guard: AP_STATE_H_664A4180 */ ype='submit' value='search'/>
blob: b769c410a214d5ccd0a4937e1e180f484241658b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
 * Replace function is_callable()
 *
 * @category    PHP
 * @package     PHP_Compat
 * @link        http://php.net/function.is_callable
 * @author      Gaetano Giunta <giunta.gaetano@sea-aeroportimilano.it>
 * @version     $Id: is_callable.php,v 1.3 2006/08/21 14:03:15 ggiunta Exp $
 * @since       PHP 4.0.6
 * @require     PHP 4.0.0 (true, false, etc...)
 * @todo        add the 3rd parameter syntax...
 */
if (!function_exists('is_callable')) {
    function is_callable($var, $syntax_only=false)
    {
        if ($syntax_only)
        {
            /* from The Manual:
            * If the syntax_only argument is TRUE the function only verifies
            * that var might be a function or method. It will only reject simple
            * variables that are not strings, or an array that does not have a
            * valid structure to be used as a callback. The valid ones are
            * supposed to have only 2 entries, the first of which is an object
            * or a string, and the second a string
            */
            return (is_string($var) || (is_array($var) && count($var) == 2 && is_string(end($var)) && (is_string(reset($var)) || is_object(reset($var)))));
        }
        else
        {
            if (is_string($var))
            {
                return function_exists($var);
            }
            else if (is_array($var) && count($var) == 2 && is_string($method = end($var)))
            {
                $obj = reset($var);
                if (is_string($obj))
                {
                    $methods = get_class_methods($obj);
                    return (bool)(is_array($methods) && in_array(strtolower($method), $methods));
                }
                else if (is_object($obj))
                {
                    return method_exists($obj, $method);
                }
            }
            return false;
        }
    }
}

?>