public static void SetOpen(Gate gate, bool open, bool notify)
 {
     instance._setOpen(gate, open, notify);
 }
 public static bool IsOpen(Gate gate)
 {
     return(instance._isOpen(gate));
 }
示例#3
0
 /// <summary>
 /// Constructor for GatesList with one gate.
 /// </summary>
 /// <param name="id">ID.</param>
 /// <param name="singleGate">Single gate in this gateslist.</param>
 public GatesList(string id, Gate singleGate)
     : base(id)
 {
     Add(singleGate);
 }
        /** The following functions call the relevant instance-specific functions. **/

        public static void SetOpen(Gate gate, bool open)
        {
            instance._setOpen(gate, open, true);
        }
示例#5
0
 /// <summary>
 /// Adds the given gate to this gateslist.
 /// </summary>
 /// <param name="gate">Gate to add.</param>
 public void Add(Gate gate)
 {
     gate.OnAttached();
     Gates.Add(gate);
 }
示例#6
0
 /// <summary>
 /// Removes the given gate from this gateslist.
 /// </summary>
 /// <param name="gate">Gate to remove.</param>
 public void Remove(Gate gate)
 {
     Gates.Remove(gate);
     gate.OnDetached();
 }
示例#7
0
 /// <summary>
 /// Determines if this world is available for starting, based on either if there
 /// is no <c>Gate</c> for this <c>World</c>, or if the <c>Gate</c> is open.
 /// </summary>
 /// <returns><c>true</c> if this instance can start; otherwise, <c>false</c>.</returns>
 public bool CanStart()
 {
     return(Gate == null || Gate.IsOpen());
 }
示例#8
0
 /// <summary>
 /// Constructor for <c>GatesList</c> with one <c>Gate</c>.
 /// </summary>
 /// <param name="id">ID.</param>
 /// <param name="singleGate">Single <c>Gate</c> in this <c>GatesList</c>.</param>
 public GatesListOR(string id, Gate singleGate)
     : base(id, singleGate)
 {
 }
示例#9
0
        /// <summary>
        /// Converts this <c>World</c> into a JSON object.
        /// </summary>
        /// <returns>The JSON object.</returns>
        public override JSONObject toJSONObject()
        {
            JSONObject obj = base.toJSONObject();

            obj.AddField(LUJSONConsts.LU_GATE, (Gate == null ? new JSONObject(JSONObject.Type.OBJECT) : Gate.toJSONObject()));

            JSONObject worldsArr = new JSONObject(JSONObject.Type.ARRAY);

            foreach (World world in InnerWorldsMap.Values)
            {
                worldsArr.Add(world.toJSONObject());
            }
            obj.AddField(LUJSONConsts.LU_WORLDS, worldsArr);

            JSONObject scoresArr = new JSONObject(JSONObject.Type.ARRAY);

            foreach (Score score in Scores.Values)
            {
                scoresArr.Add(score.toJSONObject());
            }
            obj.AddField(LUJSONConsts.LU_SCORES, scoresArr);

            JSONObject missionsArr = new JSONObject(JSONObject.Type.ARRAY);

            foreach (Mission mission in Missions)
            {
                missionsArr.Add(mission.toJSONObject());
            }
            obj.AddField(LUJSONConsts.LU_MISSIONS, missionsArr);

            return(obj);
        }
 override protected bool _isOpen(Gate gate)
 {
     return(gateStorage_IsOpen(gate.ID));
 }
 override protected void _setOpen(Gate gate, bool open, bool notify)
 {
     gateStorage_SetOpen(gate.ID, open, notify);
 }
示例#12
0
 /// <summary>
 /// Forces completion of this <c>Mission</c>.
 /// This function should not be used in standard scenarios.
 /// </summary>
 public void ForceComplete()
 {
     Gate.ForceOpen(true);
 }
示例#13
0
 /// <summary>
 /// Determines whether this <c>Mission</c> is available by checking the criteria
 /// that makes the specific <c>Mission</c> available.
 /// </summary>
 /// <returns>If this instance is available returns <c>true</c>; otherwise <c>false</c>.</returns>
 public virtual bool IsAvailable()
 {
     return(Gate.CanOpen() && Schedule.Approve(MissionStorage.GetTimesCompleted(this)));
 }