World.GameActors.GameObjects.Avatar.Update C# (CSharp) Method

Update() public method

public Update ( IAtlas atlas, ITilesetTable table ) : void
atlas IAtlas
table ITilesetTable
return void
        public void Update(IAtlas atlas, ITilesetTable table)
        {
            var temperatureAround = atlas.Temperature(Position);

            //LogAvatarStatus(atlas, temperatureAround);

            float oldEnergy = Energy;
            LoseEnergy();
            BalanceTemperature(temperatureAround, oldEnergy - Energy);
            LoseRest();

            if (Interact)
            {
                InteractWithAllInteractablesInFrontOf(atlas, table);

                Interact = false;
                return;
            }

            if (PickUp)
            {
                if (Tool == null)
                {
                    PerformPickup(atlas, table);
                }
                else
                {
                    PerformLayDown(atlas, table);
                }
                PickUp = false;
                return;
            }

            if (UseTool)
            {
                var usable = Tool as IUsableGameActor;

                if (usable != null)
                {
                    usable.Use(new GameActorPosition(this, Position, LayerType.Object), atlas, table);
                }
            }
        }