Example #1
0
        public void RemoveFurniture(Item item)
        {
            Point itemCoord = item.Coordinate;

            if (WiredUtillity.TypeIsWiredAction(item.GetBaseItem().InteractionType))
            {
                Point coordinate = item.Coordinate;
                if (!this.actionStacks.ContainsKey(coordinate))
                {
                    return;
                }

                ((List <Item>) this.actionStacks[coordinate]).Remove(item);
                if (this.actionStacks[coordinate].Count == 0)
                {
                    List <Item> NewList = new List <Item>();
                    this.actionStacks.TryRemove(coordinate, out NewList);
                }
            }
            else if (WiredUtillity.TypeIsWiredCondition(item.GetBaseItem().InteractionType))
            {
                if (!this.conditionStacks.ContainsKey(itemCoord))
                {
                    return;
                }

                ((List <Item>) this.conditionStacks[itemCoord]).Remove(item);
                if (this.conditionStacks[itemCoord].Count == 0)
                {
                    List <Item> NewList = new List <Item>();
                    this.conditionStacks.TryRemove(itemCoord, out NewList);
                }
            }
            else if (item.GetBaseItem().InteractionType == InteractionType.specialrandom)
            {
                if (this.SpecialRandom.Contains(itemCoord))
                {
                    this.SpecialRandom.Remove(itemCoord);
                }
            }
            else if (item.GetBaseItem().InteractionType == InteractionType.specialunseen)
            {
                if (this.SpecialUnseen.ContainsKey(itemCoord))
                {
                    this.SpecialUnseen.Remove(itemCoord);
                }
            }
        }
Example #2
0
        public void AddFurniture(Item item)
        {
            Point itemCoord = item.Coordinate;

            if (WiredUtillity.TypeIsWiredAction(item.GetBaseItem().InteractionType))
            {
                if (this.actionStacks.ContainsKey(itemCoord))
                {
                    ((List <Item>) this.actionStacks[itemCoord]).Add(item);
                }
                else
                {
                    this.actionStacks.TryAdd(itemCoord, new List <Item>()
                    {
                        item
                    });
                }
            }
            else if (WiredUtillity.TypeIsWiredCondition(item.GetBaseItem().InteractionType))
            {
                if (this.conditionStacks.ContainsKey(itemCoord))
                {
                    ((List <Item>) this.conditionStacks[itemCoord]).Add(item);
                }
                else
                {
                    this.conditionStacks.TryAdd(itemCoord, new List <Item>()
                    {
                        item
                    });
                }
            }
            else if (item.GetBaseItem().InteractionType == InteractionType.specialrandom)
            {
                if (!this.SpecialRandom.Contains(itemCoord))
                {
                    this.SpecialRandom.Add(itemCoord);
                }
            }
            else if (item.GetBaseItem().InteractionType == InteractionType.specialunseen)
            {
                if (!this.SpecialUnseen.ContainsKey(itemCoord))
                {
                    this.SpecialUnseen.Add(itemCoord, 0);
                }
            }
        }