Exemplo n.º 1
0
    public bool DicEquals(WorldIntDictionary x, WorldIntDictionary y)
    {
        // early-exit checks
        if (null == y)
        {
            return(null == x);
        }
        if (null == x)
        {
            return(false);
        }
        if (x.Count != y.Count)
        {
            return(false);
        }

        // check keys are the same
        foreach (WorldType k in x.Keys)
        {
            if (!y.ContainsKey(k))
            {
                return(false);
            }
        }
        // check values are the same
        foreach (WorldType k in x.Keys)
        {
            if (!x[k].Equals(y[k]))
            {
                return(false);
            }
        }

        return(true);
    }
Exemplo n.º 2
0
    public void defPlayerData()
    {
        lastDay      = DateTime.Today.ToString("yyyy-MM-dd");
        currentWorld = WorldType.house;
        WorldLocks   = new WorldIntDictionary();
        int maxHouseLevels = DataUtils.loadLevelAsset(WorldType.house).stageNames.Length;

        WorldLocks[currentWorld] = new WorldLevel(0, -1, new uint[maxHouseLevels], new ushort[maxHouseLevels]);
        lastPos = new Vector2Ser(0, 0);
    }