Crossfire JXClient, Trunk  R20561
Animation.java
Go to the documentation of this file.
1 /*
2  * This file is part of JXClient, the Fullscreen Java Crossfire Client.
3  *
4  * JXClient is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * JXClient is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with JXClient; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * Copyright (C) 2005-2008 Yann Chachkoff.
19  * Copyright (C) 2006-2011 Andreas Kirschbaum.
20  */
21 
22 package com.realtime.crossfire.jxclient.animations;
23 
24 import org.jetbrains.annotations.NotNull;
25 
31 public class Animation {
32 
36  private final int animationId;
37 
41  private final int flags;
42 
46  @NotNull
47  private final int[] faces;
48 
55  public Animation(final int animationId, final int flags, @NotNull final int[] faces) {
56  assert faces.length > 0;
57 
58  this.animationId = animationId;
59  this.flags = flags;
60  this.faces = new int[faces.length];
61  System.arraycopy(faces, 0, this.faces, 0, faces.length);
62  }
63 
68  public int getAnimationId() {
69  return animationId;
70  }
71 
76  public int getFaces() {
77  return faces.length;
78  }
79 
85  public int getFace(final int index) {
86  return faces[index];
87  }
88 
89 }
int getFace(final int index)
Returns one face of this animation.
Definition: Animation.java:85
int getFaces()
Returns the number of faces of this animation.
Definition: Animation.java:76
Animation(final int animationId, final int flags, @NotNull final int[] faces)
Creates a new instance.
Definition: Animation.java:55
final int [] faces
The faces list of the animation.
Definition: Animation.java:47
final int flags
Flags for the animation; currently unused by the server.
Definition: Animation.java:41
Manages animations received from the server.
Definition: Animation.java:31
int getAnimationId()
Returns the animation ID.
Definition: Animation.java:68