PlayerMessage.java 770 Bytes
Newer Older
1 2 3
package com.owlmaddie.ui;

import com.owlmaddie.chat.ChatDataManager;
4 5
import com.owlmaddie.chat.EntityChatData;

6 7 8 9 10 11 12
import java.util.concurrent.atomic.AtomicInteger;

/**
 * The {@code PlayerMessage} class provides a player message object, which keeps track of how
 * many ticks to remain visible, and the message to display. Similar to an EntityChatData, but
 * much simpler.
 */
13
public class PlayerMessage extends EntityChatData {
14 15
    public AtomicInteger tickCountdown;

16 17
    public PlayerMessage(String playerId, String messageText, int ticks) {
        super(playerId);
18 19 20
        this.currentMessage = messageText;
        this.currentLineNumber = 0;
        this.tickCountdown = new AtomicInteger(ticks);
21
        this.status = ChatDataManager.ChatStatus.DISPLAY;
22 23
    }
}