PageRenderTime 83ms CodeModel.GetById 78ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/world/animlayer.go

https://code.google.com/
Go | 38 lines | 19 code | 4 blank | 15 comment | 0 complexity | a3e01974e8e1b448357fc8cc6bd212c0 MD5 | raw file
 1/*
 2   Copyright 2011-2012 gtalent2@gmail.com
 3
 4   Licensed under the Apache License, Version 2.0 (the "License");
 5   you may not use this file except in compliance with the License.
 6   You may obtain a copy of the License at
 7
 8     http://www.apache.org/licenses/LICENSE-2.0
 9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15*/
16package world
17
18import (
19	"../models"
20	"github.com/gtalent/starfish/util"
21)
22
23type AnimLayer struct {
24	util.Point
25	*Animation
26}
27
28func (me *AnimLayer) Free() {
29	animations.Checkin(me.Animation.Key())
30}
31
32func loadAnimLayer(anim models.AnimLayer) AnimLayer {
33	var val AnimLayer
34	val.Point = anim.Point
35	a, _ := animations.Checkout(&anim.Animation)
36	val.Animation = a.(*Animation)
37	return val
38}