コード例 #1
0
    public void AddTempValue(EquipmentStats stats)
    {
        var eq = new EqId(stats.Id, stats.Type);

        if (!IsThisEquipmantInTempValues(stats))
        {
            tempAllowedEquipmentId.Add(eq);
        }
    }
コード例 #2
0
    public void AllowThisEquipment(EquipmentStats stats)
    {
        var eq = new EqId(stats.Id, stats.Type);

        if (!IsThisEquipmantAllowed(stats))
        {
            allowedEquipmentId.Add(eq);
        }
    }
コード例 #3
0
    public EqId GetEquipmantAllowed(EquipmentStats stats)
    {
        if (!IsThisEquipmantAllowed(stats))
        {
            throw new Exception("Ну ты че. проверь сначала...");
        }

        var eq = new EqId(stats.Id, stats.Type);

        return(allowedEquipmentId.Find(e => e.Id == eq.Id && e.Type == eq.Type));
    }
コード例 #4
0
        public EqId(EqId eqid, int?id = null, EquipmentStats.TypeOfEquipment?type = null, bool?isNew = null)
        {
            Id    = eqid.Id;
            Type  = eqid.Type;
            IsNew = eqid.IsNew;

            if (id != null)
            {
                Id = id.Value;
            }
            if (type != null)
            {
                Type = type.Value;
            }
            if (isNew != null)
            {
                IsNew = isNew.Value;
            }
        }
コード例 #5
0
    public bool IsThisEquipmantInTempValues(EquipmentStats stats)
    {
        var eq = new EqId(stats.Id, stats.Type);

        return(tempAllowedEquipmentId.FindIndex(e => e.Id == eq.Id && e.Type == eq.Type) >= 0);
    }